Skip to content

org-mode styles in headers ignored #2504

Closed
fommil opened this Issue · 6 comments

2 participants

@fommil

e.g.

** +thing+ other things

is rendered literally, rather than having the strike styling applied to thing. Same for bold/italics/etc.

@tarleb

I tried this with both the current version and v1.13.2.1, but wasn't able to reproduce this.

$ echo "** +thing+ other things" | pandoc -f org -t native
[Header 2 ("",[],[]) [Strikeout [Str "thing"],Space,Str "other",Space,Str "things"]]

Which Pandoc version are you using and what's the output format?

@fommil

it's in a reveal.js slide if that helps. I'm using cabal install pandoc v1.15.1.1. I'll add you to the repo so you can check :smile:

@fommil

@tarleb I shared my slides with you, try doing this on the section titled Product (e.g. change to +Product+ HList)

@tarleb

Thanks for the sources, I can reproduce it now and am implementing a fix. A minimal version for this bug would be

echo "foo\n\n** +test+ testing\n" | pandoc -f org -t native
[Para [Str "foo"]
,Header 2 ("",[],[]) [Str "+test+",Space,Str "testing"]]

A (very hacky) temporary fix might be to use plain text as the first text in the header. E.g.
** <200b> +Product+ Hlist, where `<200b> is the zero-width whitespace (C-x 8 RET 200b). The extra space should be hardly noticeable in reveal.js.

@fommil

Great, I'll try that! Any idea if you'll get round to the HTML attr parsing? That'd be awesome for setting background images.

@tarleb tarleb added a commit to tarleb/pandoc that referenced this issue
@tarleb tarleb Org reader: fix markup parsing in headers
Markup as the very first item in a header wasn't recognized.  This was
caused by an incorrect parser state: positions at which inline markup
can start need to be marked explicitly by changing the parser state.
This wasn't done for headers.  The proper function to update the state
is now called at the beginning of the header parser, fixing this issue.

This fixes #2504.
e3b4844
@tarleb

I haven't really looked into it yet, sorry.

@jgm jgm closed this in #2505
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.