emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* bug: html export, latex fragments and emphasize
@ 2010-11-12  1:28 Nicolas Goaziou
  2010-11-12 10:52 ` Eric S Fraga
  2010-11-12 13:22 ` Carsten Dominik
  0 siblings, 2 replies; 3+ messages in thread
From: Nicolas Goaziou @ 2010-11-12  1:28 UTC (permalink / raw)
  To: Org Mode List

Hello,

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?

Regards,

--
Nicolas

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: bug: html export, latex fragments and emphasize
  2010-11-12  1:28 bug: html export, latex fragments and emphasize Nicolas Goaziou
@ 2010-11-12 10:52 ` Eric S Fraga
  2010-11-12 13:22 ` Carsten Dominik
  1 sibling, 0 replies; 3+ messages in thread
From: Eric S Fraga @ 2010-11-12 10:52 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org Mode List

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> 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.

Just to confirm that this problem exists for me as well even when using
=\( ... \)= instead of =$ ...$= constructs (which I believe is safer).

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 23.2.1
: using Org-mode version 7.3 (release_7.3.42.g0fd5ec)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: bug: html export, latex fragments and emphasize
  2010-11-12  1:28 bug: html export, latex fragments and emphasize Nicolas Goaziou
  2010-11-12 10:52 ` Eric S Fraga
@ 2010-11-12 13:22 ` Carsten Dominik
  1 sibling, 0 replies; 3+ messages in thread
From: Carsten Dominik @ 2010-11-12 13:22 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org Mode List


On Nov 11, 2010, at 7:28 PM, Nicolas Goaziou wrote:

> Hello,
>
> 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?

Hi Nicolas,

I am not entirely sure if it could be removed.  The origin of this
is to make begin_html ... end_html work to keep entire blocks  
unmodified.  It is possible that the code after this line by now has  
enough checks for protectedness - but I am not sure.

For the time being, I have pushed a different fix which does fix the  
specific issue you show, but will still fail if the math expression in  
more than 2 lines :(

It might be worth while to switch the protected html part off and see  
what happens - but that would have to be done on a special branch with  
significant testing by a number of people.

Regards

- Carsten

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-11-12 13:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-12  1:28 bug: html export, latex fragments and emphasize Nicolas Goaziou
2010-11-12 10:52 ` Eric S Fraga
2010-11-12 13:22 ` Carsten Dominik

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).