From 3fb682c705aac65ef990251413c20c80bbe4455d Mon Sep 17 00:00:00 2001 From: Sven Greb Date: Sun, 26 Mar 2023 22:22:17 +0100 Subject: [PATCH] Support for `remark-lint-strikethrough-marker` 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 --- packages/@svengreb/remark-preset-lint/rules/support.js | 7 +++++++ rules/emphasis.md | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/@svengreb/remark-preset-lint/rules/support.js b/packages/@svengreb/remark-preset-lint/rules/support.js index 05c77a9..d3f013f 100644 --- a/packages/@svengreb/remark-preset-lint/rules/support.js +++ b/packages/@svengreb/remark-preset-lint/rules/support.js @@ -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. @@ -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, "~~"], ], }; diff --git a/rules/emphasis.md b/rules/emphasis.md index 8f3e78c..fd1919f 100644 --- a/rules/emphasis.md +++ b/rules/emphasis.md @@ -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 @@ -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