Reputation: 70
Markdown currently converts indented lines as code blocks. For code I use the tilde character ~
. I don't need tabs to get converted into code. Instead I want to use tabs to organize the raw markdown so that the raw markdown is more readable. Basically I want to use tabs to improve text readability just like we use tabs for code readability.
How do I do that? Is there a flavour of markdown that supports that?
Upvotes: 2
Views: 2577
Reputation: 331
Is there a flavour of markdown that supports that?
Yes: markdown-it
mostly does (as https://github.com/11ty/eleventy/issues/2438#issue-1271419451 well explains).
How do I do that?
markdownit().disable('code')
Upvotes: 0
Reputation: 42467
No, this is not a supported Markdown variant.
As a reminder, fenced code blocks (tilde deliminated) are not standard Markdown. They do not appear anywhere in the original rules or in more recent variants of the rules. Any parser which does support them, does so as an add-on. For example, PHP Markdown Extra, which first introduced fenced code blocks, refers to them as an "extension" or "addition" to the standard Markdown syntax. And GitHub Flavored Markdown (which helped popularize fenced code blocks) labels itself as a "superset" of Markdown with the added features being referred to as "extensions".
That being that case, the added features are an addition to, not a replacement for, the standard syntax. If you don't have indented code blocks, then you don't have Markdown.
That said, a few of the Markdown parsers do have extension APIs which give you sufficient access to the parser so that you can write your own extension which modifies the parser's behavior. You could conceivably write an extension which disables the parsing of indented code blocks. However, you would be left with a very odd situation. For example, nesting lists relies heavily on indentation. You would likely need to completely replace all of the list and indented code block related parsing. And, as lists and indented code blocks can be nested in blockquotes, you would need to replace that code as well. And then the paragraph parser may need altered to handle the new scheme. At that point, you no longer have Markdown and it would probably be easier to just create your own parser from scratch which would not be a Markdown parser, but something else entirely.
Upvotes: 2