You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way for pandoc to output syntax highlighted code blocks in mediawiki format (possibly using the <source> or <syntaxhighlight> tags)? Preferably without converting < to <.
Background
If I have a markdown file ~/test-r.md:
A function in `R`:
```R
x <- 3
x + 5
## 8
```
pandoc -f mediawiki ~/test-r.md outputs
A function in <code>R</code>:
<pre class="r">x <- 3
x + 5
## 8</pre>
which is rendered on mediawiki sites without R-specific syntax highlighting:
If I manually change the tags to either <syntaxhighlight lang="r"> or <source lang="r"> (as described here)I get output with syntax highlighting:
However, the odd assignment operator conventions in R, <-, causes troubles since pandoc converted the < to <, and it needs to be manually changed back to achieve the desired output (possibly related):
The text was updated successfully, but these errors were encountered:
joelostblom
changed the title
Format code blocks in MediaWiki markup with <source> or <syntax> tags rather than <pre>
Format code blocks in MediaWiki markup with <source> or <syntaxhighligh> tags rather than <pre>
Feb 21, 2017
joelostblom
changed the title
Format code blocks in MediaWiki markup with <source> or <syntaxhighligh> tags rather than <pre>
Format code blocks in MediaWiki markup with <source> or <syntaxhighlight> tags rather than <pre>
Feb 21, 2017
Is there a way for pandoc to output syntax highlighted code blocks in mediawiki format (possibly using the
<source>
or<syntaxhighlight>
tags)? Preferably without converting<
to<
.Background
If I have a markdown file
~/test-r.md
:pandoc -f mediawiki ~/test-r.md
outputswhich is rendered on mediawiki sites without R-specific syntax highlighting:
If I manually change the tags to either
<syntaxhighlight lang="r">
or<source lang="r">
(as described here)I get output with syntax highlighting:However, the odd assignment operator conventions in R,
<-
, causes troubles since pandoc converted the<
to<
, and it needs to be manually changed back to achieve the desired output (possibly related):The text was updated successfully, but these errors were encountered: