Skip to content
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

Tabs turn into spaces in embedded HTML <pre> tag #2835

Closed
borisvassilev opened this issue Apr 1, 2016 · 4 comments
Closed

Tabs turn into spaces in embedded HTML <pre> tag #2835

borisvassilev opened this issue Apr 1, 2016 · 4 comments

Comments

@borisvassilev
Copy link

This might be related to #2804, or not at all. I can't say if it a regression this time. Again, easy to reproduce, but not so easy to notice, or to show: GitHub does something weird with tabs, too. I attach the two files from this command:

$ pandoc foo.txt >foo.html.txt

Opening both with a browser should make it obvious.

PS. From what I understand, really all white space is supposed to be preserved in a <pre> tag.

foo.txt
foo.html.txt

@borisvassilev
Copy link
Author

Hmm, it seems that I am not able to figure out the "attach files" thing here. It is trivial to reproduce, anyway. This input file should be enough:

<pre>
a [tab character here] b
</pre>

@borisvassilev
Copy link
Author

Note: an embedded &#9; in the markdown portion of a document actually does get converted to a single tab character in the output:

$ cat bar.txt
&#9;some text 
$ pandoc bar.txt
<p> some text</p>

Again, GitHub doesn't show this correctly, but between the opening <p> and some text there is a single tab character in the output of Pandoc.

Tab characters (not character entities) become spaces.

@jgm
Copy link
Owner

jgm commented Apr 2, 2016

Pandoc, like most Markdown processors, expands all tabs with a 4-space tab stop before parsing.
Even in code blocks.

CommonMark is an exception, so you could try -f commonmark if you don't need pandoc-specific extensions.

@jgm jgm closed this as completed Apr 2, 2016
@jgm
Copy link
Owner

jgm commented Apr 3, 2016

I'm sorry, I'd forgotten to mention the --preserve-tabs option!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants