public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* webtex generated image in Markdown does not convert to HTML
@ 2022-02-03 14:30 christophe dervieux
       [not found] ` <6b387ee2-1203-49c2-ae2c-a57eef54611dn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: christophe dervieux @ 2022-02-03 14:30 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 2463 bytes --]



Take this md document

$ echo -e '$$\n\\frac{x}{y}\n$$' > test.md
$ cat test.md
$$
\frac{x}{y}
$$

It can be converted using webtex in Markdown to use an image

$ pandoc -t gfm --webtex test.md
![
\\frac{x}{y}
](https://latex.codecogs.com/png.latex?%0A%5Cfrac%7Bx%7D%7By%7D%0A "
\frac{x}{y}
")

There is some new line inserted inside what should be an image link in 
markdown. I was expecting this 

![\\frac{x}{y}](https://latex.codecogs.com/png.latex?%0A%5Cfrac%7Bx%7D%7By%7D%0A "\frac{x}{y}")

This happens the same with -t markdown and currently it prevent rendering 
the new markdown to html

$ pandoc -t markdown --webtex -o test-webtex.md test.md
$ cat test-webtex.md
![
\\frac{x}{y}
](https://latex.codecogs.com/png.latex?%0A%5Cfrac%7Bx%7D%7By%7D%0A "
\frac{x}{y}
")

$ pandoc -f markdown -t html test-webtex.md
<p>[
\frac{x}{y}](https://latex.codecogs.com/png.latex?%0A%5Cfrac%7Bx%7D%7By%7D%0A
” “)</p>

$ pandoc -f gfm -t html test-webtex.md
<p><embed
src="https://latex.codecogs.com/png.latex?%0A%5Cfrac%7Bx%7D%7By%7D%0A"
title="
\frac{x}{y}
" /></p>
`

It seems the markdown reader and the gfm reader do not see the same thing 

$ pandoc -t native -f markdown test-webtex.md
[ Para
    [ Str "["
    , SoftBreak
    , Str
        "\\frac{x}{y}](https://latex.codecogs.com/png.latex?%0A%5Cfrac%7Bx%7D%7By%7D%0A"
    , Space
    , Str "\8221"
    , SoftBreak
    , RawInline (Format "tex") "\\frac{x}{y}"
    , SoftBreak
    , Str "\8220)"
    ]
]
$ pandoc -t native -f gfm test-webtex.md
[ Para
    [ Image
        ( "" , [] , [] )
        [ SoftBreak , Str "\\frac{x}{y}" , SoftBreak ]
        ( "https://latex.codecogs.com/png.latex?%0A%5Cfrac%7Bx%7D%7By%7D%0A"
        , "\n\\frac{x}{y}\n"
        )
    ]
]

Is the way of writing the image expected ?
Is webtex really supported for gfm only ?
Is there an extension to activate in markdown to support this the same as 
with gfm ? 

*Pandoc version?*

$ pandoc --version
pandoc 2.17.1.1

​

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/6b387ee2-1203-49c2-ae2c-a57eef54611dn%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 14872 bytes --]

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

end of thread, other threads:[~2022-02-03 16:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-03 14:30 webtex generated image in Markdown does not convert to HTML christophe dervieux
     [not found] ` <6b387ee2-1203-49c2-ae2c-a57eef54611dn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-02-03 16:25   ` John MacFarlane
     [not found]     ` <m24k5f534k.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
2022-02-03 16:51       ` christophe dervieux

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 NNTP newsgroup(s).