Code blocks must be left intact #1668
Labels
category: code blocks
L1 - broken
Valid usage causes incorrect output OR a crash AND there is no known workaround for the issue
Describe the bug
Code blocks are very controlled content, where the author has intent (and full responsibility) on everything inside it. Right now, tabs inside code blocks are replaced by 4 spaces. This is (probably in most of the cases) semantically incorrect.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The contents of the code block should be left intact (tabs untouched).
Many times, code in a document is used as an example or reference to be copied/pasted or used "as is". Marked is not aware of the purpose of the code, so it should not take action on it and leave it intact.
This is a real world example of this problem: ckeditor/github-writer#170. The code block is a suggestion for changes to source code and they can be merged as the author wrote it. Marked is changing the code though and, basically, breaking the author contribution.
I can imagine this being a problem on many other contexts as well.
I've seen similar issues here for the same problem. Most of them are not clear and mainly closed. I wanted to refresh this problem with this issue.
The text was updated successfully, but these errors were encountered: