gollum icon indicating copy to clipboard operation
gollum copied to clipboard

Using pandoc-ruby escapes double backslash

Open fhchl opened this issue 3 years ago • 3 comments

Describe the bug A double backslash \\ is escaped when using pandoc-ruby as the markdown renderer.

To Reproduce

$$a \\ b$$

produces ab with environment

Gollum 5.2.3
Running on: x86_64-linux-gnu with Ruby version 2.7.0
Using:
rugged 1.1.1
gollum-rugged_adapter 1.1.1
gollum-lib 5.1.3
Markdown rendering gem: pandoc-ruby
Other renderering gems:
none

Expected behavior Should instead produce

a
b

as it does with environment

Gollum 5.2.3
Running on: x86_64-linux-gnu with Ruby version 2.7.0
Using:
rugged 1.1.1
gollum-rugged_adapter 1.1.1
gollum-lib 5.1.3
Markdown rendering gem: kramdown
Other renderering gems:
none

fhchl avatar Oct 22 '21 15:10 fhchl

I haven't had time to dig into this yet.

One thing we should verify and document here is whether pandoc-ruby renders this $$a \\ b$$ the way we expect it to outside of the context of Gollum. This will help us be confident that it's indeed a bug in Gollum.

benjaminwil avatar Oct 27 '21 17:10 benjaminwil

From irb:

2.6.3 :005 > PandocRuby.new('$$a \\ b$$').to_html
 => "<p><span class=\"math display\"><em>a</em> <em>b</em></span></p>\n" 

So I think this is no gollum bug?

dometto avatar Nov 13 '21 10:11 dometto

...although we invoke PandocRuby in a slightly different way. Strangely, mimicking that call doesn't reproduce the expected ab, but it also doesn't render the \\ as a newline:

2.6.3 :028 > PandocRuby.convert("Test $$a \\ b$$ foo", '--citeproc', :from => 'markdown-tex_math_dollars-raw_tex', :to => :html)
 => "<p>Test $$a  b$$ foo</p>\n" 

dometto avatar Nov 13 '21 10:11 dometto

When I enter $$a \\ b$$ in the MathJax demo here I get the same result as in gollum (i.e. ab), so I'll close this as not a bug. Feel free to reopen if I'm missing something here.

dometto avatar Nov 13 '22 16:11 dometto