emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master bb13183: (shr-insert): Also remove soft hypens from


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master bb13183: (shr-insert): Also remove soft hypens from non-folded text.
Date: Sun, 01 Mar 2015 11:21:48 +0000

branch: master
commit bb13183c1bb56724fc3c4ab5ed8f1eaf6ed5338d
Author: Lars Magne Ingebrigtsen <address@hidden>
Commit: Lars Magne Ingebrigtsen <address@hidden>

    (shr-insert): Also remove soft hypens from non-folded text.
---
 lisp/ChangeLog  |    1 +
 lisp/net/shr.el |   10 +++++++++-
 2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c6ef717..1bcc4f1 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,6 +1,7 @@
 2015-03-01  Lars Magne Ingebrigtsen  <address@hidden>
 
        * net/shr.el (shr-insert): Remove soft hyphens.
+       (shr-insert): Also remove soft hypens from non-folded text.
 
 2015-02-28  Eli Zaretskii  <address@hidden>
 
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index 868af38..9d88d1f 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -495,7 +495,15 @@ size, and full-buffer size."
     (insert "\n"))
   (cond
    ((eq shr-folding-mode 'none)
-    (insert text))
+    (let ((start (point)))
+      (insert text)
+      (save-restriction
+       (narrow-to-region start (point))
+       ;; Remove soft hyphens.
+       (goto-char (point-min))
+       (while (search-forward "­" nil t)
+         (replace-match "" t t))
+       (goto-char (point-max)))))
    (t
     (let ((font-start (point)))
       (when (and (string-match "\\`[ \t\n\r ]" text)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]