-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: markdown extension: native_tables
#3154
Comments
In Text.Pandoc.Pretty we do take into account widths of east
Yes. The problem is that an HTML table might contain |
About the table width issue, I am now not so sure if it is a bug or user error. I did some short tests again and the Chinese characters are treated as 2 English characters wide. I might go back to my original document when I got the problem to see if it is really a bug or user error. Regarding the raw HTML table in Markdown, could a table extension (upon the 4 existing table extensions) be added, |
To make my suggestion clearer, I suggest an extension similar to
|
native_tables
How pandoc handles table without table extensions and raw HTML
In
test.md
:In command line:
pandoc -t markdown-simple_tables-multiline_tables-grid_tables-pipe_tables-raw_html -o test-pandoc.md test.md
Output in
test-pandoc.md
:The interesting result is that even if all table extensions are disabled, and raw HTML not allow, somehow the table still "make it through" in markdown to markdown conversion.
Defying the expectation from this behavior
After realizing this behavior, I was prepared to use native HTML table as the "5th pandoc table extensions", kind of like pandoc native span and div.
But, in command line:
pandoc -o test-pandoc-pandoc.md test-pandoc.md
will produce an output (test-pandoc-pandoc.md) identical to input (test-pandoc.md). Hence, pandoc seems not to recognize the table is a table anymore. Otherwise it should convert it into 1 of the 4 table extensions.Running
pandoc -o test-pandoc.tex test-pandoc.md
confirms the results. The output is not a table:Suggestion
After seeing this behavior, I find it handy if raw HTML table can be used in pandoc as the 5th table extension. If a cell is a block, it seems the only approach to do so currently is through
grid_tables
. But I don't use emacs, and when I testedgrid_tables
with unicode character (Chinese in my case), the|
won't aligned visually (Should this be regarded as a bug by the way? In the manual it is mentioned monospace font is expected to be used for the alignment, but as far as I know there's no font that match the width of 1 English character to 1 Chinese character. There's actually such English character in Chinese font, but they are not really "English" as in ASCII, but some kind of unicode characters as well.).Using raw HTML table to write table with cell that is a block seems much easier. But it only make sense if it is treated as a native pandoc table extensions.
As a sidenote, this is kind of similar to issue #3152: turning markdown extensions on and off seems non-trivial in pandoc.
The text was updated successfully, but these errors were encountered: