diff --git a/src/constants/regular-expressions.ts b/src/constants/regular-expressions.ts index a896237e..f470ccba 100644 --- a/src/constants/regular-expressions.ts +++ b/src/constants/regular-expressions.ts @@ -3,4 +3,11 @@ */ const REGEX_LINE_BREAKS = /(?:\r\n|\r|\n)/g -export { REGEX_LINE_BREAKS } +/** + * A regex for standard punctuation characters for US-ASCII plus unicode punctuation. + * + * @see https://stackoverflow.com/a/25575009 + */ +const REGEX_PUNCTUATION = /[\u2000-\u206f\u2e00-\u2e7f'!"#$%&()*+,\-./:;<=>?@\\[\]^_`{|}~]/ + +export { REGEX_LINE_BREAKS, REGEX_PUNCTUATION } diff --git a/src/serializers/markdown/markdown.test.ts b/src/serializers/markdown/markdown.test.ts index c18de1d3..1c3f9f40 100644 --- a/src/serializers/markdown/markdown.test.ts +++ b/src/serializers/markdown/markdown.test.ts @@ -11,6 +11,13 @@ import { createMarkdownSerializer } from './markdown' import type { MarkdownSerializerReturnType } from './markdown' +const HTML_INPUT_SPECIAL_HTML_CHARS = `Ambition & Balance
+<doist>
+</doist>
+<doist></doist>
+"Doist"
+'Doist'` + const HTML_INPUT_HEADINGS = `

Heading level 1

Heading level 2

Heading level 3

@@ -94,11 +101,6 @@ const HTML_INPUT_UNORDERED_LISTS = `
-
-