-
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
Tabs within code block are converted to 4 spaces? #644
Comments
Same problem here. I think this is definitely a bug: code blocks should not be modified in any way. That's the behaviour promoted by CommonMark. Discount and Pandoc, however, also seem to convert tabs to spaces. |
You're right, commonmark says that. However, marked heavily relies on the fact that everything is indented with spaces. Code blocks, list, blockquotes... |
If it is not possible to let tabs remain the same, atleast allow the user the select the number of spaces they want. |
@vixalien you can convert them before you send the markdown to marked. // tab is 2 spaces
marked.parse(markdown.replace(/\t/g, ' ')) |
You can see I have to code blocks one with a two space indentation and one with a tab. The tab is oddly converted to 4 spaces.
"```js\nif (true) {\n console.log('word spaces')\n}\n```\n```js\nif (true) {\n\tconsole.log('word tabs')\n}\n```"
"<pre><code class=\"lang-js\">if (true) {\n console.log('word spaces')\n}\n</code></pre>\n<pre><code class=\"lang-js\">if (true) {\n console.log('word tabs')\n}\n</code></pre>\n"
The text was updated successfully, but these errors were encountered: