Skip to content

Commit

Permalink
Support for remark-lint-strikethrough-marker (#68)
Browse files Browse the repository at this point in the history
To warn when the number of strikethrough markers is inconsistent and
does not use two strikethrough markers (`~~`) the
`remark-lint-strikethrough-marker` [1] has been added to support such
checks.

[1]: https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-strikethrough-marker

GH-67
  • Loading branch information
svengreb committed Apr 27, 2023
1 parent 57d2f2c commit 154b026
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions packages/@svengreb/remark-preset-lint/rules/support.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import footnotes from "remark-footnotes";
import frontmatter from "remark-frontmatter";
import gfm from "remark-gfm";
import strikethroughMarker from "remark-lint-strikethrough-marker";

/**
* Support for plugins of specification addons and variants.
Expand Down Expand Up @@ -50,6 +51,12 @@ const support = {
tablePipeAlign: true,
},
],
/**
* Warn when the number of strikethrough markers is inconsistent and does not use two strikethrough markers.
* @see https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-strikethrough-marker
* @see https://github.com/svengreb/styleguide-markdown/blob/main/rules/emphasis.md#strikethrough
*/
[strikethroughMarker, "~~"],
],
};

Expand Down
3 changes: 2 additions & 1 deletion rules/emphasis.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Use two (2) asterisk `*` marker to generate spans for bold formatted text.
Use two (2) tilde `~` marker to generate spans for strikethrough text.

> remark-lint: [emphasis-marker][2]
> remark-lint: [strikethrough-marker][6], [emphasis-marker][2]
###### Examples

Expand Down Expand Up @@ -171,3 +171,4 @@ __ Snow __
[3]: https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-emphasis-as-heading
[4]: https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-inline-padding
[5]: https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-strong-marker
[6]: https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-strikethrough-marker

0 comments on commit 154b026

Please sign in to comment.