mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-26 01:36:03 +03:00
[GH-ISSUE #391] MD037 triggers when using inline LaTeX #2176
Labels
No labels
bug
enhancement
enhancement
enhancement
fixed in next
fixed in next
fixed in next
new rule
new rule
new rule
pull-request
question
refactoring
refactoring
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/markdownlint#2176
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @marek-zeleny on GitHub (Apr 25, 2021).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/391
Hi, there's a very similar problem with
*within a LaTeX block.Text between the first
*(within the LaTeX expression) and the second*(starting the highlighted text) gets underlined as an error MD037.By the way, thanks for doing this, it's an awesome tool :)
Originally posted by @marek-zeleny in https://github.com/DavidAnson/markdownlint/issues/357#issuecomment-826346603
@DavidAnson commented on GitHub (Apr 25, 2021):
If it's recognized as a code block, that rule should ignore the content like so: https://dlaa.me/markdownlint/#%25m%23%20Issue%20391%0A%0A%60Some%20text%20%24a%20*%20b%24%20some%20highlighted%20text.%60%0A
But by default math blocks are not recognized by the parser so it's probably treating this like text. You can add a plug-in for math blocks and it should fix this problem by ignoring them. Here's an example test case that does that with the
markdown-it-texmathplugin: https://github.com/DavidAnson/markdownlint/blob/main/test/markdownlint-test.js#L1459-L1481@marek-zeleny commented on GitHub (Apr 25, 2021):
I was using a math parser included in Markdown All in One and after reading your suggestion I tried using Markdown+Math instead, but neither of them helped resolving the issue.
Markdown+Matheven claims to be built onmarkdown-it-texmath. Do I have to explicitely use the plugin withinmarkdownlint(which would be quite inconvenient), or is there some other problem in my approach?Thanks
@DavidAnson commented on GitHub (Apr 25, 2021):
How are you doing this all? Are you using the VS Code extension for
markdownlint? It includesmarkdown-it-texmathby default. Are you usingmarkdownlint-cli2? That lets you reference plugins. Please describe your scenario.@marek-zeleny commented on GitHub (Apr 25, 2021):
I'm using VS Code with extensions
markdownlint,Markdown All in Oneand now I tried alsoMarkdown+Math. I haven't been usingmarkdownlint-cli2yet, because I'm mainly on Windows and if I understand it correctly,cli2can be used (apart from CLI) only as a project-specific file, while I'd like to have this as a global setting.@DavidAnson commented on GitHub (Apr 25, 2021):
Please share a simple example of Markdown that is flagging this error unexpectedly. I will transfer this issue to that project if applicable.
I don't think the other extensions in your scenario here are helping or hurting for this specific issue. CLI2 expects to be configured per project, yes.
@lihykang commented on GitHub (Apr 26, 2021):
Tôi không nhận được máy
Được gửi từ Thưhttps://go.microsoft.com/fwlink/?LinkId=550986 dành cho Windows 10
Từ: David @.>
Đã gửi: 26 Tháng Tư 2021 6:48 SA
Đến: @.>
Cc: @.***>
Chủ đề: Re: [DavidAnson/markdownlint] MD037 triggers when using inline LaTeX (#391)
Please share a simple example of Markdown that is flagging this error unexpectedly. I will transfer this issue to that project if applicable.
I don't think the other extensions in your scenario here are helping or hurting for this specific issue. CLI2 expects to be configured per project, yes.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHubhttps://github.com/DavidAnson/markdownlint/issues/391#issuecomment-826416589, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ATZZ3FZNC7SAIXJ4W6FQ7N3TKSS4RANCNFSM43RNG4WA.
@marek-zeleny commented on GitHub (Apr 26, 2021):
I tried adding the
markdown-it-texmathplugin inmarkdownlint-cli2and the previous error now disappeared, so it probably works as expected. I was using the example I gave in the opening comment of this ticket.Thank you for your very quick and helpful responses. If you like, you might take this as a suggestion - it would be nice to have some global settings of the activated plugins (and possibly other things configurable by
cli2) with the possibility to override them locally per project.Have a nice day and thank you again for this project, it's really great!
@DavidAnson commented on GitHub (Apr 26, 2021):
I've added a note to my list of possible future changes, thank you!