Commit 1e463294 authored by Lars Magne Ingebrigtsen's avatar Lars Magne Ingebrigtsen Committed by Katsumi Yamaoka
Browse files

shr.el (shr-insert): Tweak line breaking.

shr.el (shr-insert): Handle <pre> better.
parent 5d2ef6db
2010-10-04 Lars Magne Ingebrigtsen <>
* shr.el (shr-ensure-paragraph): Fix the non-empty line case.
(shr-insert): Tweak line breaking.
(shr-insert): Handle <pre> better.
2010-10-04 Julien Danjou <>
......@@ -214,14 +214,14 @@ fit these criteria."
(defun shr-tag-pre (cont)
(let ((shr-folding-mode nil))
(let ((shr-folding-mode 'none))
(shr-generic cont)
(defun shr-tag-blockquote (cont)
(let ((shr-indentation (+ shr-indentation 4)))
(shr-tag-pre cont)))
(shr-generic cont)))
(defun shr-ensure-newline ()
(unless (zerop (current-column))
......@@ -233,7 +233,7 @@ fit these criteria."
(setq shr-state nil))
((eq shr-folding-mode 'none)
(insert t))
(insert text))
(let ((first t)
......@@ -244,7 +244,9 @@ fit these criteria."
(setq column (current-column))
(when (> column 0)
((> (+ column (length elem) 1) shr-width)
((and (or (not first)
(eq shr-state 'space))
(> (+ column (length elem) 1) shr-width))
(insert "\n"))
((not first)
(insert " "))))
......@@ -258,9 +260,11 @@ fit these criteria."
(unless shr-start
(setq shr-start (point)))
(insert elem))
(setq shr-state nil)
(when (and (string-match "[ \t\n]\\'" text)
(not (bolp)))
(insert " "))))))
(insert " ")
(setq shr-state 'space))))))
(defun shr-get-image-data (url)
"Get image data for URL.
......@@ -293,7 +297,8 @@ Return a string with image data."
(shr-generic cont))
(defun shr-tag-br (cont)
(unless (bobp)
(insert "\n"))
(shr-generic cont))
(defun shr-tag-h1 (cont)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment