Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: quickfix for mkdocs (#51) #52

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions test/markdown-admonition.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"default": false,
"max-one-sentence-per-line": {
"ignored_words": [
"ie",
"i.e",
"eg",
"e.g",
"etc",
"ex",
"!!",
"??"
Comment on lines +11 to +12
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the work around

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it two characters instead of three on purpose?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, because the logic takes a look at the element in front of a line ending, (line ending is defined by another regex) and compares those, not including the matched regex. as the third exclamation mark is part of the regex, we only need two here

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation! It would be great to get this workaround

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this to my .markdownlint.yaml and it works. Thanks!

],
"line_endings": [
".",
"?",
"!"
],
"context_length": 14
}
}
7 changes: 7 additions & 0 deletions test/markdown-admonition.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# max-one-sentence-per-line

## Text

!!! note admonition

??? other stuff
16 changes: 16 additions & 0 deletions test/snapshots/rules-tests.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ The actual snapshot is saved in `rules-tests.js.snap`.

Generated by [AVA](https://avajs.dev).

## markdown-admonition.md

> Snapshot 1

{
errors: [],
fixed: `# max-one-sentence-per-line␊
## Text␊
!!! note admonition␊
??? other stuff␊
`,
}

## sentences-per-line.md

> Snapshot 1
Expand Down
Binary file modified test/snapshots/rules-tests.js.snap
Binary file not shown.
Loading