fix: non leading-tabs in markdown content (#1559)#2434
fix: non leading-tabs in markdown content (#1559)#2434UziTech merged 4 commits intomarkedjs:masterfrom
Conversation
Only replaces tabs at the beginning of a block construct. Tabs in the middle of the item are unaffected. All tests passing. Tabs in both GFM and CommonMark at 100% fixes markedjs#1559
|
This pull request is being automatically deployed with Vercel (learn more). marked-website – ./🔍 Inspect: https://vercel.com/markedjs/marked-website/D3uTfybfhra66Kx3bbv8kgdEqMw5 markedjs – ./🔍 Inspect: https://vercel.com/markedjs-legacy/markedjs/A1UvPUv6aE5erAJmpiDKM5my7xeg |
|
Does this look good now? |
calculuschild
left a comment
There was a problem hiding this comment.
Looks good to me. Only question is if there might be some other token that needs its rules.js updated to handle tabs?
There was a problem hiding this comment.
I did find one example that seems broken.
> test
// tab between > and testIt is actually currently kind of broken (additional spaces are added to the output) but with this PR it creates a code element in the blockquote.
Looks like https://github.com/markedjs/marked/blob/master/src/Tokenizer.js#L154 might have to be updated to remove a tab after > as well.
|
Ok seems like that might be a case that's missing a test. I'll see about putting one together for it. |
|
@calculuschild I think this now passes any test I can think of. |
calculuschild
left a comment
There was a problem hiding this comment.
Cool, I approve then. I can't think of anything else either.
|
🎉 This PR is included in version 4.0.14 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [4.0.14](markedjs/marked@v4.0.13...v4.0.14) (2022-04-11) ### Bug Fixes * only convert leading tabs to spaces ([#1559](markedjs/marked#1559)) ([#2434](markedjs/marked#2434)) ([1103690](markedjs/marked@1103690))
Marked version:
Markdown flavor: CommonMark
Description
Only replaces tabs at the beginning of a block construct. Tabs in the middle of the item are unaffected.
Contributor
Committer
In most cases, this should be a different person than the contributor.