diff --git a/lisp/org-exp.el b/lisp/org-exp.el index 919288ae1..cd979c774 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -2147,7 +2147,7 @@ INDENT was the original indentation of the block." (org-add-props (concat "\n") - '(org-protected t)) + '(org-protected t org-example t)) "#+END_DOCBOOK\n")) ((eq backend 'html) ;; We are exporting to HTML @@ -2217,7 +2217,7 @@ INDENT was the original indentation of the block." cont rpllbl fmt))) (if (string-match "\\(\\`<[^>]*>\\)\n" rtn) (setq rtn (replace-match "\\1" t nil rtn))) - (concat "\n#+BEGIN_HTML\n" (org-add-props rtn '(org-protected t)) "\n#+END_HTML\n\n")) + (concat "\n#+BEGIN_HTML\n" (org-add-props rtn '(org-protected t org-example t)) "\n#+END_HTML\n\n")) ((eq backend 'latex) (setq rtn (org-export-number-lines rtn 'latex 0 0 num cont rpllbl fmt)) (concat "#+BEGIN_LaTeX\n" @@ -2241,7 +2241,7 @@ INDENT was the original indentation of the block." rtn "\\end{lstlisting}\n") (concat (car org-export-latex-verbatim-wrap) rtn (cdr org-export-latex-verbatim-wrap))) - '(org-protected t)) + '(org-protected t org-example t)) "#+END_LaTeX\n")) ((eq backend 'ascii) ;; This is not HTML or LaTeX, so just make it an example. @@ -2255,7 +2255,7 @@ INDENT was the original indentation of the block." (org-split-string rtn "\n") "\n") "\n") - '(org-protected t)) + '(org-protected t org-example t)) "#+END_ASCII\n")))) (org-add-props rtn nil 'original-indentation indent)))) diff --git a/lisp/org-html.el b/lisp/org-html.el index d5809abb8..4a6ded4a4 100644 --- a/lisp/org-html.el +++ b/lisp/org-html.el @@ -2146,11 +2146,17 @@ If there are links in the string, don't modify these." (defvar local-list-indent) (defvar local-list-type) (defun org-export-html-close-lists-maybe (line) + "Close local lists based on the original indentation of the line." (let* ((rawhtml (and in-local-list - (get-text-property 0 'org-protected line))) + (get-text-property 0 'org-protected line) + (not (get-text-property 0 'org-example line)))) + ;; rawhtml means: This was between #+begin_html..#+end_html + ;; originally, thus it excludes stuff that was a source code example + ;; Actually, this code seems wrong, I don't know why it works, but + ;; it seems to work.... So keep it like this for now. (ind (if rawhtml (org-get-indentation line) - (or (get-text-property 0 'original-indentation line)))) + (get-text-property 0 'original-indentation line))) didclose) (when ind (while (and in-local-list