rmarkdown to html: tables do not render if + or - present in header row #2765
oliverdrechsel
commented
Example from linked post:
| | IP_gene8-_1st| IP_gene8+_1st|
|:--------------|-------------:|-------------:|
|IP_gene8-_1st | 1.0000000| 0.4357325|
|IP_gene8+_1st | 0.4357325| 1.0000000|
Interestingly revealing case:
pandoc -t native
| a |
|----|
| a+_b |
| 1 |
^D
[Table [] [AlignDefault] [0.0]
[[Plain [Str "a"]]]
[[[Plain [Str "a+_b",Space,Str "|",SoftBreak,Str "|",Space,Str "1",Space,Str "|"]]]]]
Note also that pandoc allows +
as well as |
as a pipe separator. (This is to achieve compatibility with org-mode tables, which are easy to create in Emacs.)
So literal +
characters should be backslash-escaped.
oliverdrechsel
commented
I tried a bit more and it seems the \_
is necessary to get a valid html table.
a+_b
doesn't work
a\+_b
doesn't work
a+\_b
works
a+b
works
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As soon as one puts strings ending with '+' or '-' in the header of tables, they will not render as table, but as normal text, in html.
The issue was described with example data here:
http://stackoverflow.com/questions/35798605/how-to-markdown-html-tables-containing-plus-minus