Skip to content

Restore pre 1.16 behavior wrapping Span contents in braces in LaTeX output? #2624

Closed
bpj opened this Issue · 0 comments

1 participant

@bpj
bpj commented

Opening issue as requested by @jgm on the mailing list!

Edit: wrapped my code blocks from the mail in fences to have them display correctly

Den 2016-01-06 kl. 16:43, skrev John MacFarlane:

+++ BP Jonsson [Jan 06 16 16:19 ]:

Den 2016-01-03 kl. 08:01, skrev John MACFARLANE:

Happy New Year! I'm pleased to announce pandoc 1.16.

I have discovered what might be a bug:

Markdown like this

 \foo<span>bar</span>

used to give LaTeX like this

 \foo{bar}

but now it gives

 \foobar

i.e. spans used to give a brace pair in LaTeX output, which was
very convenient when generating LaTeX and HTML from the same
source.
I hope this change wasn't intentional as I have lots of files
relying on the old behavior!

This wasn't intentional (on my part anyway). I tracked the
change down to this commit:

9328f4c

In particular, look at:

9328f4c#diff-6a8fc7aaca1a905daff4fdbac7490325L762

The code that inserted braces under certain conditions has
been removed. Perhaps Mauro can comment on whether this
was intentional, and what was the reason?

The old code was a bit convoluted, but we should fix
this and restore the old behavior, I think. (Feel free
to put up an issue on the tracker noting the change.)

Den 2016-01-06 kl. 17:14, skrev mb21:

I didn't realize people were relying on that behaviour when I made the
change. If I remember correctly, I assumed this was an unintended
side-effect of the code, since just {bar} produces only bar in the PDF
produces by LaTeX. Ifhttps://github.com/jgm/pandoc/issues/2542 is
implemented as discussed in the comments, bar
should produce \foo{bar} and thus cover this use case. But we may still
want to revert the behaviour for backwards-compatibility.

Meanwhile I have made a filter which mimicks the old behavior for those who like me have files and/or filters relying on the old behavior:

https://gist.github.com/bpj/20ff7452590ad1692028#file-pandoc-brace-spans-py

By the way the filter I linked in #2542 got broken with 1.16, so you have to put the filter above before it in your filter chain!

@jgm jgm added a commit that closed this issue
@jgm LaTeX writer: restore old treatment of Span.
A Span is rendered with surrounding {braces}.

This was a regression in 1.16.  Closes #2624.
1506e62
@jgm jgm closed this in 1506e62
@c-forster c-forster pushed a commit to c-forster/pandoc that referenced this issue
@jgm LaTeX writer: restore old treatment of Span.
A Span is rendered with surrounding {braces}.

This was a regression in 1.16.  Closes #2624.
797787a
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.