Closed csm10495 closed 2 weeks ago
You have "no highlighting" selected in try pandoc. If you don't select this, you'll get highlighting. https://pandoc.org/try/?params=%7B%22text%22%3A%22%23+Comparing+%601.cfg%60+%26+%602.cfg%60%5Cn%5Cn+*+*Ordering+differences+only*%5Cn%5Cn%60%60%60diff%5Cn%40%40+-29612%2C20+%2B29612%2C20+%40%40%5Cn%2B++++apple+sauce%5Cn-++++tomatoes%5Cn%60%60%60%5Cn%5Cn%22%2C%22to%22%3A%22html5%22%2C%22from%22%3A%22markdown%22%2C%22standalone%22%3Afalse%2C%22embed-resources%22%3Afalse%2C%22table-of-contents%22%3Afalse%2C%22number-sections%22%3Afalse%2C%22citeproc%22%3Afalse%2C%22html-math-method%22%3A%22plain%22%2C%22wrap%22%3A%22auto%22%2C%22highlight-style%22%3A%22pygments%22%2C%22files%22%3A%7B%7D%2C%22template%22%3Anull%7D
Using pandoc on the command line, you'll need to add -s
(for "standalone" document) in order to get the necessary CSS definitions.
pandoc -f gfm /tmp/1.md -s -o /tmp/1b.html
Explain the problem. Link: https://pandoc.org/try/?params=%7B%22text%22%3A%22%23+Comparing+%601.cfg%60+%26+%602.cfg%60%5Cn%5Cn+*+*Ordering+differences+only*%5Cn%5Cn%60%60%60diff%5Cn%40%40+-29612%2C20+%2B29612%2C20+%40%40%5Cn%2B++++apple+sauce%5Cn-++++tomatoes%5Cn%60%60%60%5Cn%5Cn%22%2C%22to%22%3A%22html5%22%2C%22from%22%3A%22markdown%22%2C%22standalone%22%3Afalse%2C%22embed-resources%22%3Afalse%2C%22table-of-contents%22%3Afalse%2C%22number-sections%22%3Afalse%2C%22citeproc%22%3Afalse%2C%22html-math-method%22%3A%22plain%22%2C%22wrap%22%3A%22auto%22%2C%22highlight-style%22%3Anull%2C%22files%22%3A%7B%7D%2C%22template%22%3Anull%7D
To locally reproduce, take 1.md : 1.md
then run it through pandoc like so:
open /tmp/1b.html and there won't be green for added lines and red for removed lines. Github markdown notices this pattern to render diffs.
For example:
Markdown preview in vscode also properly renders it:
Pandoc version?
On a M2 Macbook