diff options
author | Carsten Dominik <carsten.dominik@gmail.com> | 2010-11-12 07:18:09 -0600 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2010-11-12 07:18:09 -0600 |
commit | 85e1f9760fd2fa3d50fe34ea18b3b3907926c3b8 (patch) | |
tree | bbd3bf5084cbb793245b147712f6f4a982089c78 | |
parent | 0fd5ec58c6e058b6a7c5463a0dea53e91c7330ad (diff) | |
download | org-mode-85e1f9760fd2fa3d50fe34ea18b3b3907926c3b8.tar.gz |
Fix partial line protection issue
* lisp/org-html.el (org-export-as-html): Do not treat partially
protected lines as if they were fully protected.
Nicolas Goaziou writes:
> Here is a problem when a latex fragment is split across two lines and
> an emphasize follows. The text won't be italicized upon exporting to
> HTML.
>
> =====
> * latex-fragments bug
>
> Imagine we have a formula starting here $e^{i\pi} +
> 1 = 0$. Now we have a problem with /emphasize/.
> =====
>
> This is because the line starts with a char with 'org-protected
> property and, thus, get caught by the "Protected HTML" (org-html.el
> l. 1216) part of `org-export-as-html'. In others words, the line is
> inserted as-is in the output buffer, before getting any
> transformation.
>
> I'm not sure how it should be done (I don't get yet the usefulness of
> this "Protected HTML" part), but that piece of code may be moved after
> the `org-html-expand' call, as long as every sub-function in
> `org-html-expand' has a check to prevent modifying protected stuff
> (this not yet the case for `org-export-with-emphasize' and
> `org-html-protect' while others seem ok).
>
> But even in this case, every function getting called after that would
> be ignored. So, for example, links would not be inserted.
>
> Couldn't the "Protected HTML" part be removed altogether?
-rw-r--r-- | lisp/org-html.el | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/org-html.el b/lisp/org-html.el index 68fee5b..4305af2 100644 --- a/lisp/org-html.el +++ b/lisp/org-html.el @@ -1213,7 +1213,11 @@ lang=\"%s\" xml:lang=\"%s\"> (throw 'nextline nil)) ;; Protected HTML - (when (get-text-property 0 'org-protected line) + (when (and (get-text-property 0 'org-protected line) + ;; Make sure it is the entire line that is protected + (not (< (or (next-single-property-change + 0 'org-protected line) 10000) + (length line)))) (let (par (ind (get-text-property 0 'original-indentation line))) (when (re-search-backward "\\(<p>\\)\\([ \t\r\n]*\\)\\=" (- (point) 100) t) |