Closed RokeJulianLockhart closed 2 days ago
I have this problem when converting txt readmes into markdown, because indent the body text under headings. it's really, really annoying, because I have to use lists for nested headings. if there's an extension that does this I'll gladly use that, but I haven't found one
@RokeJulianLockhart
https://github.com/microsoft/vscode/issues/234485#issuecomment-2495650513
@JaredRichardWilliam, glad you agree! I'd actually forgotten about that - indented content under headings in .txt
files was the reason I originally staved off using Markdown for so long. I've also used the same solution, but by following how YAML uses list-like syntax for nested keys. It works in some parsers, but can look strange in GLFM and Discourse.
This sounds like a good fit for a markdown extension. These can add support for new syntax or modify existing syntax
Our built-in markdown support targets standard markdown which will parse your examples differently than you want
Our built-in markdown support targets standard markdown which will parse your examples differently than you want
@mjbvz, CommonMark?
Yes we try to match common mark. Common mark will not parse your example well at all because everything until the blank line is considered inline html
https://github.com/microsoft/vscode/issues/234485#event-15423275988
@mjbvz, I presume you meant to close as unplanned?
Desire
As I've poorly aforedescribed at
reddit.com/r/vscode
(to 5 upvotes), I want a way to disable the conversion of a single tab or 2 spaces to a<pre><code>
. Instead, I want it these to merely be ignored (as they are in other markup languages, like HTML).Rationale
I author most of my markup in HTML, because it provides significantly more versatile and semantic markup capabilities. However, it has an (ultimately non-inherent, but in-practice) significant failure —
<code>
tags are not automatically syntax-highlighted by any parsers.Markdown, being a superset of HTML, improves this perfectly. As an example, when I render the undermentioned in VS Code with the PowerShell extension installed, I see beautiful colours:
However, that's really difficult to read. It gets exponentially more difficult if, for example, you have nested tables with code blocks in each. At that stage, I basically have to re-indent and then de-indent each time I modify the markup. It's a dreadful workflow.
Instead, it should be the undermentioned:
However, all beneath the first
<td>
shall render in a<pre><code>
.This is, of course, a basic example, where the aforedescribed potential complexity is less evident. However, I can provide incredibly complex examples if necessary.
Summarily, having this implemented would completely change how I write my Markdown documents. I would finally be able to write the HTML within them in a readable manner, and have syntax-highlighted code blocks, without needing to deal with the indentation havoc that is
<pre>
.Feasibility
Per https://github.com/11ty/eleventy/issues/2438#issuecomment-2464912554, this should be possible in VS Code, since
markdown-it
appears to be the parser that VS Code uses, and it supports the ability to disable indented code blocks.Corroberations
"A switch that disables code blocks by indenting" at
forum.obsidian.md/t/21764
"Inline HTML breaks when using indentation" at
talk.commonmark.org/t/3317
^1https://github.com/jgm/pandoc/issues/2120#issue-71270331
https://github.com/11ty/eleventy/issues/2438#issue-1271419451
"Disable “indent -> code block”" at
forum.obsidian.md/t/19173
"Break Markdown: Option to change default tab / indent behavior / Do not create code block" at
forum.obsidian.md/t/8741/5
"This is how to use Markdown inside HTML blocks" at
forum.obsidian.md/t/74435/14
"Change the code block button from inserting indentation to triple-backticks" at
meta.stackoverflow.com/revisions/414866/1
:Reposts
Interested