![]() Closes #29176 This PR fix an issue where uncommenting a code block in Markdown would add Markdown comments instead of removing the language-specific comments. Why? `language_scope_at` for comments in a code block in Markdown would result in the language being detected as Markdown. This happens because the smallest range, such as `//` or `#` on the Markdown layer, is preferred over `// whole comment line` for any other language. This results in language detection as Markdown for that point. To fix this, we also use a depth factor and try to prefer the layer with greater depth over one with lesser depth. In this case, the code block's language depth would be preferred over Markdown. The smallest range is now used as a tiebreaker. Added test for this case. Release Notes: - Fixed issue where uncommenting a code block in Markdown would add Markdown comments instead of removing the language comments. |
||
---|---|---|
.. | ||
src | ||
build.rs | ||
Cargo.toml | ||
LICENSE-GPL |