Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
bpj opened this issue Jan 6, 2016 · 0 comments
Closed

Comments

@bpj
Copy link

bpj commented Jan 6, 2016

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//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 closed this as completed in 1506e62 Jan 9, 2016
c-forster pushed a commit to c-forster/pandoc that referenced this issue Mar 4, 2016
A Span is rendered with surrounding {braces}.

This was a regression in 1.16.  Closes jgm#2624.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant