Browse Source

Fix minor problems with blockquote and verse HTML export.

Xerxes Folupa writes:

> I spotted a little inconsistency in the way Org strips tags when
> processing #+begin_verse ... #+end_verse, and #+begin_quote
> ... #+end_quote blocks, compared with other literal blocks that strip
> superfluous <p> tags correctly (e.g. #+html)

[...]

> Additional question: is the space before the <br/> in verse blocks a
> design decision?

This patch fixes these issues.
Carsten Dominik 16 years ago
parent
commit
0216c9a27c
2 changed files with 10 additions and 1 deletions
  1. 7 0
      lisp/ChangeLog
  2. 3 1
      lisp/org-exp.el

+ 7 - 0
lisp/ChangeLog

@@ -1,3 +1,10 @@
+2008-12-07  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-exp.el (org-export-as-html): Do not add a space before
+	enforces line breaks.
+	(org-export-as-html): Close paragraph before blockquote and verse
+	tags.
+
 2008-12-05  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org-agenda.el (org-agenda-goto-calendar): Remove duplicate let

+ 3 - 1
lisp/org-exp.el

@@ -3206,12 +3206,14 @@ lang=\"%s\" xml:lang=\"%s\">
 
 	  ;; Blockquotes and verse
 	  (when (equal "ORG-BLOCKQUOTE-START" line)
+	    (org-close-par-maybe)
 	    (insert "<blockquote>\n<p>\n")
 	    (throw 'nextline nil))
 	  (when (equal "ORG-BLOCKQUOTE-END" line)
 	    (insert "</p>\n</blockquote>\n")
 	    (throw 'nextline nil))
 	  (when (equal "ORG-VERSE-START" line)
+	    (org-close-par-maybe)
 	    (insert "\n<p class=\"verse\">\n")
 	    (setq inverse t)
 	    (throw 'nextline nil))
@@ -3225,7 +3227,7 @@ lang=\"%s\" xml:lang=\"%s\">
 		  (setq line (concat (mapconcat 'identity
 						(make-list (* 2 i) "\\nbsp") "")
 				     " " (org-trim line))))
-	      (setq line (concat line " \\\\"))))
+	      (setq line (concat line "\\\\"))))
 
 	  ;; make targets to anchors
 	  (while (string-match "<<<?\\([^<>]*\\)>>>?\\((INVISIBLE)\\)?[ \t]*\n?" line)