@chayns-components/format 5.0.0-beta.650 → 5.0.0-beta.674

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/lib/cjs/types/format.js +2 -0
  2. package/lib/cjs/types/format.js.map +1 -0
  3. package/lib/cjs/utils/escape.js +1 -3
  4. package/lib/cjs/utils/escape.js.map +1 -1
  5. package/lib/cjs/utils/formatString/bb-code/findBBCode.js +6 -4
  6. package/lib/cjs/utils/formatString/bb-code/findBBCode.js.map +1 -1
  7. package/lib/cjs/utils/formatString/bb-code/formatBBCode.js +37 -37
  8. package/lib/cjs/utils/formatString/bb-code/formatBBCode.js.map +1 -1
  9. package/lib/cjs/utils/formatString/formatString.js +30 -42
  10. package/lib/cjs/utils/formatString/formatString.js.map +1 -1
  11. package/lib/cjs/utils/formatString/formatString.test.js +549 -0
  12. package/lib/cjs/utils/formatString/formatString.test.js.map +1 -0
  13. package/lib/cjs/utils/formatString/markdown/formatMarkdown.js +145 -29
  14. package/lib/cjs/utils/formatString/markdown/formatMarkdown.js.map +1 -1
  15. package/lib/esm/types/format.js +2 -0
  16. package/lib/esm/types/format.js.map +1 -0
  17. package/lib/esm/utils/escape.js +0 -1
  18. package/lib/esm/utils/escape.js.map +1 -1
  19. package/lib/esm/utils/formatString/bb-code/findBBCode.js +6 -4
  20. package/lib/esm/utils/formatString/bb-code/findBBCode.js.map +1 -1
  21. package/lib/esm/utils/formatString/bb-code/formatBBCode.js +37 -39
  22. package/lib/esm/utils/formatString/bb-code/formatBBCode.js.map +1 -1
  23. package/lib/esm/utils/formatString/formatString.js +33 -45
  24. package/lib/esm/utils/formatString/formatString.js.map +1 -1
  25. package/lib/esm/utils/formatString/formatString.test.js +547 -0
  26. package/lib/esm/utils/formatString/formatString.test.js.map +1 -0
  27. package/lib/esm/utils/formatString/markdown/formatMarkdown.js +141 -26
  28. package/lib/esm/utils/formatString/markdown/formatMarkdown.js.map +1 -1
  29. package/lib/types/types/format.d.ts +5 -0
  30. package/lib/types/utils/escape.d.ts +0 -1
  31. package/lib/types/utils/formatString/bb-code/findBBCode.d.ts +2 -0
  32. package/lib/types/utils/formatString/bb-code/formatBBCode.d.ts +3 -4
  33. package/lib/types/utils/formatString/formatString.d.ts +1 -3
  34. package/lib/types/utils/formatString/formatString.test.d.ts +1 -0
  35. package/lib/types/utils/formatString/markdown/formatMarkdown.d.ts +3 -1
  36. package/package.json +6 -4
  37. package/lib/cjs/utils/formatString/markdown/formatMarkdownTable.js +0 -86
  38. package/lib/cjs/utils/formatString/markdown/formatMarkdownTable.js.map +0 -1
  39. package/lib/esm/utils/formatString/markdown/formatMarkdownTable.js +0 -78
  40. package/lib/esm/utils/formatString/markdown/formatMarkdownTable.js.map +0 -1
  41. package/lib/types/utils/formatString/markdown/formatMarkdownTable.d.ts +0 -9
@@ -1 +1 @@
1
- {"version":3,"file":"formatBBCode.js","names":["findFirstBBCode","BB_CODE_HTML_TAG_PREFIX","BLOCK_LEVEL_TAGS","INLINE_LEVEL_TAGS","HTML_CODE_PATTERN","parseBBCode","text","options","justEscapeSquareBrackets","customBlockLevelBBCodeTags","customBlockLevelTags","customInlineLevelBBCodeTags","customInlineLevelTags","html","parseBehindIndex","length","htmlToParse","slice","firstCodeElementMatch","exec","firstBBCodeMatch","index","content","fullMatch","parameters","Tag","tag","toLowerCase","isValidTag","includes","isBlockLevelTag","parsedContent","replace","indexOfFullMatch","indexOf","htmlAfterTag","openTag","closeTag","isCustomTag","htmlTag","openingTag","Object","entries","map","_ref","key","value","join","closingTag"],"sources":["../../../../../src/utils/formatString/bb-code/formatBBCode.ts"],"sourcesContent":["import { findFirstBBCode } from './findBBCode';\n\nconst BB_CODE_HTML_TAG_PREFIX = 'bb-code-';\n\nconst BLOCK_LEVEL_TAGS = ['center', 'ul', 'ol', 'li', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p'];\nconst INLINE_LEVEL_TAGS = ['b', 'strong', 'i', 'em', 'u', 's', 'span', 'img'];\n\nconst HTML_CODE_PATTERN = /(?:<code>|<code class=\"inline-code\">)[\\s\\S]*?<\\/code>/;\n\nexport interface ParseBBCodesOptions {\n customBlockLevelBBCodeTags?: string[];\n customInlineLevelBBCodeTags?: string[];\n}\n\ninterface PrivateParseBBCodesOptions extends ParseBBCodesOptions {\n // When justEscapeSquareBrackets is true, this function is simply used to escape square brackets of bb-code tags and nothing else!\n justEscapeSquareBrackets?: boolean;\n}\n\n// Parses BB-Code to HTML recursively.\n// When justEscapeSquareBrackets is true, square brackets are escaped to prevent conflicts between markdown and BB Code.\n// In that case the function only escapes square brackets and doesn't remove line breaks.\nexport const parseBBCode = (text: string, options?: PrivateParseBBCodesOptions) => {\n const {\n justEscapeSquareBrackets = false,\n customBlockLevelBBCodeTags: customBlockLevelTags = [],\n customInlineLevelBBCodeTags: customInlineLevelTags = [],\n } = options || {};\n\n let html = text;\n\n // This index is used to keep track of the position in the html string that is being parsed.\n let parseBehindIndex = 0;\n\n while (parseBehindIndex < html.length) {\n const htmlToParse = html.slice(parseBehindIndex);\n\n const firstCodeElementMatch = HTML_CODE_PATTERN.exec(htmlToParse);\n const firstBBCodeMatch = findFirstBBCode(htmlToParse);\n\n // Stops parsing if no BB-Code is found.\n if (!firstBBCodeMatch) {\n return html;\n }\n\n // Prevents bb-code parsing within code block.\n if (\n firstCodeElementMatch &&\n firstBBCodeMatch &&\n firstCodeElementMatch.index < firstBBCodeMatch.index\n ) {\n // If a code block is found before a BB-Code tag, BB-Code parsing continues behind the code block.\n parseBehindIndex += firstCodeElementMatch.index + firstCodeElementMatch[0].length;\n // eslint-disable-next-line no-continue\n continue;\n }\n\n const { content, fullMatch, parameters, index } = firstBBCodeMatch;\n\n const Tag = firstBBCodeMatch.tag.toLowerCase();\n const isValidTag = [\n ...BLOCK_LEVEL_TAGS,\n ...customBlockLevelTags,\n ...INLINE_LEVEL_TAGS,\n ...customInlineLevelTags,\n ].includes(Tag);\n const isBlockLevelTag = [...BLOCK_LEVEL_TAGS, ...customBlockLevelTags].includes(Tag);\n\n // Ignores tags that are not supported.\n if (!isValidTag) {\n // The parsing continues behind the first square bracket of the BB-Code tag.\n parseBehindIndex += index + 1;\n // eslint-disable-next-line no-continue\n continue;\n }\n\n // Converts BB-Code tag's content before converting itself, because it may contain other BB-Codes.\n let parsedContent = parseBBCode(content);\n\n // Removes leading and trailing line-breaks from within bb code elements, to prevent unwanted spacing.\n if (!justEscapeSquareBrackets) {\n parsedContent = parsedContent.replace(/^\\n+|\\n+$/g, '');\n }\n\n const indexOfFullMatch = html.indexOf(fullMatch);\n\n let htmlAfterTag = html.slice(indexOfFullMatch + fullMatch.length);\n\n // Removes leading line-break (ONE, NOT ALL) after block level elements, to prevent unwanted spacing.\n if (!justEscapeSquareBrackets && isBlockLevelTag) {\n htmlAfterTag = htmlAfterTag.replace(/^\\n/, '');\n }\n\n // Use escaped square brackets to prevent conflicts between markdown and BB Code.\n const openTag = justEscapeSquareBrackets ? '&#91;' : '<';\n const closeTag = justEscapeSquareBrackets ? '&#93;' : '>';\n\n // TODO Don't alter content of bb-code tags when justEscapeSquareBrackets is true.\n // This is necessary to preserve whitespaces in bb-code tags within code blocks.\n\n const isCustomTag = [...customBlockLevelTags, ...customInlineLevelTags].includes(Tag);\n const htmlTag =\n !justEscapeSquareBrackets && isCustomTag ? `${BB_CODE_HTML_TAG_PREFIX}${Tag}` : Tag;\n const openingTag = `${openTag}${htmlTag}${Object.entries(parameters).length > 0 ? ' ' : ''}${Object.entries(\n parameters,\n )\n .map(([key, value]) => `${key}=\"${value}\"`)\n .join(' ')}${closeTag}`;\n const closingTag = `${openTag}/${htmlTag}${closeTag}`;\n html =\n html.slice(0, indexOfFullMatch) +\n openingTag +\n parsedContent +\n closingTag +\n htmlAfterTag;\n\n // Continues parsing behind the parsed bb-code.\n parseBehindIndex =\n indexOfFullMatch + openingTag.length + parsedContent.length + closingTag.length;\n }\n\n return html;\n};\n"],"mappings":"AAAA,SAASA,eAAe,QAAQ,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AMc,OAAO,GACT,CAAC/B,wBAAwB,IAAI8B,WAAW,GAAG,GAAGrC,uBAAuB,GAAGwB,GAAG,EAAE,GAAGA,GAAG;IACvF,MAAMe,UAAU,GAAG,GAAGJ,OAAO,GAAGG,OAAO,GAAGE,MAAM,CAACC,OAAO,CAAClB,UAAU,CAAC,CAACT,MAAM,GAAG,CAAC,GAAG,GAAG,GAAG,EAAE,GAAG0B,MAAM,CAACC,OAAO,CACvGlB,UACJ,CAAC,CACImB,GAAG,CAACC,IAAA;MAAA,IAAC,CAACC,GAAG,EAAEC,KAAK,CAAC,GAAAF,IAAA;MAAA,OAAK,GAAGC,GAAG,KAAKC,KAAK,GAAG;IAAA,EAAC,CAC1CC,IAAI,CAAC,GAAG,CAAC,GAAGV,QAAQ,EAAE;IAC3B,MAAMW,UAAU,GAAG,GAAGZ,OAAO,IAAIG,OAAO,GAAGF,QAAQ,EAAE;IACrDxB,IAAI,GACAA,IAAI,CAACI,KAAK,CAAC,CAAC,EAAEgB,gBAAgB,CAAC,GAC/BO,UAAU,GACVT,aAAa,GACbiB,UAAU,GACVb,YAAY;;IAEhB;IACArB,gBAAgB,GACZmB,gBAAgB,GAAGO,UAAU,CAACzB,MAAM,GAAGgB,aAAa,CAAChB,MAAM,GAAGiC,UAAU,CAACjC,MAAM;EACvF;EAEA,OAAOF,IAAI;AACf,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"formatBBCode.js","names":["findFirstBBCode","BB_CODE_HTML_TAG_PREFIX","BLOCK_LEVEL_TAGS","INLINE_LEVEL_TAGS","parseBBCode","text","options","customBlockLevelBBCodeTags","customBlockLevelTags","customInlineLevelBBCodeTags","customInlineLevelTags","justEscapeSquareBrackets","html","parseBehindIndex","length","htmlToParse","slice","firstBBCodeMatch","content","fullMatch","parameters","index","openingTag","closingTag","Tag","tag","toLowerCase","isValidTag","includes","isBlockLevelTag","parsedContent","indexOfFullMatch","indexOf","escapedOpeningTag","escapeBBCodeSquareBrackets","escapedClosingTag","replace","htmlAfterTag","isCustomTag","htmlTag","openingHtmlTag","Object","entries","map","_ref","key","value","join","closingHtmlTag","element","replaceAll","unescapeBBCodeSquareBrackets"],"sources":["../../../../../src/utils/formatString/bb-code/formatBBCode.ts"],"sourcesContent":["import { findFirstBBCode } from './findBBCode';\n\nconst BB_CODE_HTML_TAG_PREFIX = 'bb-code-';\n\nconst BLOCK_LEVEL_TAGS = ['center', 'ul', 'ol', 'li', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p'];\nconst INLINE_LEVEL_TAGS = ['b', 'strong', 'i', 'em', 'u', 's', 'span', 'img'];\n\nexport interface ParseBBCodesOptions {\n customBlockLevelBBCodeTags?: string[];\n customInlineLevelBBCodeTags?: string[];\n justEscapeSquareBrackets?: boolean;\n}\n\n// Parses BB-Code to HTML recursively.\n// When justEscapeSquareBrackets is true, square brackets are escaped to prevent conflicts between markdown and BB Code.\n// In that case the function only escapes square brackets and doesn't remove line breaks.\nexport const parseBBCode = (text: string, options?: ParseBBCodesOptions) => {\n const {\n customBlockLevelBBCodeTags: customBlockLevelTags = [],\n customInlineLevelBBCodeTags: customInlineLevelTags = [],\n justEscapeSquareBrackets = false,\n } = options || {};\n\n let html = text;\n\n // This index is used to keep track of the position in the html string that is being parsed.\n let parseBehindIndex = 0;\n\n while (parseBehindIndex < html.length) {\n const htmlToParse = html.slice(parseBehindIndex);\n\n const firstBBCodeMatch = findFirstBBCode(htmlToParse);\n\n // Stops parsing if no BB-Code is found.\n if (!firstBBCodeMatch) {\n return html;\n }\n\n const { content, fullMatch, parameters, index, openingTag, closingTag } = firstBBCodeMatch;\n\n const Tag = firstBBCodeMatch.tag.toLowerCase();\n const isValidTag = [\n ...BLOCK_LEVEL_TAGS,\n ...customBlockLevelTags,\n ...INLINE_LEVEL_TAGS,\n ...customInlineLevelTags,\n ].includes(Tag);\n const isBlockLevelTag = [...BLOCK_LEVEL_TAGS, ...customBlockLevelTags].includes(Tag);\n\n // Ignores tags that are not supported.\n if (!isValidTag) {\n // The parsing continues behind the first square bracket of the BB-Code tag.\n parseBehindIndex += index + 1;\n // eslint-disable-next-line no-continue\n continue;\n }\n\n // Converts BB-Code tag's content before converting itself, because it may contain other BB-Codes.\n let parsedContent = parseBBCode(content, options);\n\n if (justEscapeSquareBrackets) {\n const indexOfFullMatch = html.indexOf(fullMatch);\n const escapedOpeningTag = escapeBBCodeSquareBrackets(openingTag);\n const escapedClosingTag = escapeBBCodeSquareBrackets(closingTag);\n\n // Removes leading and trailing line-breaks from within bb code elements, to prevent unwanted spacing.\n // This needs to be done before formatting Markdown, so the Markdown formatting doesn't interpret line breaks unexpectedly.\n parsedContent = parsedContent.replace(/^\\n+|\\n+$/g, '');\n\n // Simply escapes the square brackets of the BB-Code opening and closing tag.\n html =\n html.slice(0, indexOfFullMatch) +\n escapedOpeningTag +\n parsedContent +\n escapedClosingTag +\n html.slice(indexOfFullMatch + fullMatch.length);\n\n // Continues parsing behind the parsed bb-code.\n parseBehindIndex =\n indexOfFullMatch +\n escapedOpeningTag.length +\n parsedContent.length +\n escapedClosingTag.length;\n } else {\n const indexOfFullMatch = html.indexOf(fullMatch);\n\n let htmlAfterTag = html.slice(indexOfFullMatch + fullMatch.length);\n\n // Removes leading line-break (ONE, NOT ALL) after block level elements, to prevent unwanted spacing.\n if (isBlockLevelTag) {\n htmlAfterTag = htmlAfterTag.replace(/^\\n/, '');\n }\n\n const isCustomTag = [...customBlockLevelTags, ...customInlineLevelTags].includes(Tag);\n const htmlTag = isCustomTag ? `${BB_CODE_HTML_TAG_PREFIX}${Tag}` : Tag;\n const openingHtmlTag = `<${htmlTag}${Object.entries(parameters).length > 0 ? ' ' : ''}${Object.entries(\n parameters,\n )\n .map(([key, value]) => `${key}=\"${value}\"`)\n .join(' ')}>`;\n const closingHtmlTag = `</${htmlTag}>`;\n\n const element =\n Tag === 'img' ? openingHtmlTag : openingHtmlTag + parsedContent + closingHtmlTag;\n\n html = `${html.slice(0, indexOfFullMatch)}${element}${htmlAfterTag}`;\n\n // Continues parsing behind the parsed bb-code.\n parseBehindIndex = indexOfFullMatch + element.length;\n }\n }\n\n return html;\n};\n\nexport const escapeBBCodeSquareBrackets = (text: string) =>\n text.replaceAll('[', '&zwj;[&zwj;').replaceAll(']', '&zwj;]&zwj;');\n\nexport const unescapeBBCodeSquareBrackets = (text: string) =>\n text.replaceAll('&zwj;[&zwj;', '[').replaceAll('&zwj;]&zwj;', ']');\n"],"mappings":"AAAA,SAASA,eAAe,QAAQ,cAAc;AAE9C,MAAMC,uBAAuB,GAAG,UAAU;AAE1C,MAAMC,gBAAgB,GAAG,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC;AAC9F,MAAMC,iBAAiB,GAAG,CAAC,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC;AAQ7E;AACA;AACA;AACA,OAAO,MAAMC,WAAW,GAAGA,CAACC,IAAY,EAAEC,OAA6B,KAAK;EACxE,MAAM;IACFC,0BAA0B,EAAEC,oBAAoB,GAAG,EAAE;IACrDC,2BAA2B,EAAEC,qBAAqB,GAAG,EAAE;IACvDC,wBAAwB,GAAG;EAC/B,CAAC,GAAGL,OAAO,IAAI,CAAC,CAAC;EAEjB,IAAIM,IAAI,GAAGP,IAAI;;EAEf;EACA,IAAIQ,gBAAgB,GAAG,CAAC;EAExB,OAAOA,gBAAgB,GAAGD,IAAI,CAACE,MAAM,EAAE;IACnC,MAAMC,WAAW,GAAGH,IAAI,CAACI,KAAK,CAACH,gBAAgB,CAAC;IAEhD,MAAMI,gBAAgB,GAAGjB,eAAe,CAACe,WAAW,CAAC;;IAErD;IACA,IAAI,CAACE,gBAAgB,EAAE;MACnB,OAAOL,IAAI;IACf;IAEA,MAAM;MAAEM,OAAO;MAAEC,SAAS;M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AAC6C,UAAU,CAAC,GAAG,EAAE,aAAa,CAAC,CAACA,UAAU,CAAC,GAAG,EAAE,aAAa,CAAC;AAEtE,OAAO,MAAMC,4BAA4B,GAAI9C,IAAY,IACrDA,IAAI,CAAC6C,UAAU,CAAC,aAAa,EAAE,GAAG,CAAC,CAACA,UAAU,CAAC,aAAa,EAAE,GAAG,CAAC","ignoreList":[]}
@@ -1,7 +1,6 @@
1
- import { escapeHtmlInText, unescapeSquareBrackets } from '../escape';
2
- import { parseBBCode } from './bb-code/formatBBCode';
3
- import { parseMarkdown } from './markdown/formatMarkdown';
4
- import { parseMarkdownTables } from './markdown/formatMarkdownTable';
1
+ import { escapeHtmlInText } from '../escape';
2
+ import { parseBBCode, unescapeBBCodeSquareBrackets } from './bb-code/formatBBCode';
3
+ import { getMarkdownTables, parseMarkdown } from './markdown/formatMarkdown';
5
4
  // This function takes a string and returns formatted html as a string.
6
5
  export const formatStringToHtml = (string, options) => {
7
6
  if (!string) {
@@ -11,71 +10,60 @@ export const formatStringToHtml = (string, options) => {
11
10
  };
12
11
  }
13
12
  const {
14
- escapeHtml: escapeHtmlOption = false,
15
13
  parseMarkdown: parseMarkdownOption = true,
16
- parseMarkdownTables: parseMarkdownTablesOption = false,
17
14
  parseBBCode: parseBBCodeOption = false,
18
15
  customInlineLevelBBCodeTags = [],
19
16
  customBlockLevelBBCodeTags = []
20
17
  } = options || {};
21
18
  let formattedString = string;
22
19
 
23
- // Escapes HTML.
24
- if (escapeHtmlOption) {
25
- formattedString = escapeHtmlInText(formattedString);
26
- }
27
-
28
- // Escape BB-Code square brackets, to prevent conflicts between markdown and BB Code.
29
- /* Conflict example:
30
- When Sidekick detects a function call as an entity through NER, then the following text is returned.
31
- '[nerReplace <params>]function[/nerReplace](<params>)'
32
- Because '[/nerReplace](<params>)' is a valid Markdown link, the Markdown parser would interpret it as a link
33
- and thus prevent the BB-Code parser from recognizing the BB-Code. Parsing the BB-Code first would prevent this
34
- issue. Unfortunately the Markdown parser doesn't support this.
35
- */
36
- const shouldTemporarilyEscapeBBCodeBrackets = parseMarkdownOption && parseBBCodeOption;
37
- if (shouldTemporarilyEscapeBBCodeBrackets) {
20
+ // Needs to get the tables before escaping html and parsing bb-code, so the original content can be extracted.
21
+ const tables = [];
22
+ if (parseMarkdownOption) {
38
23
  try {
39
- formattedString = parseBBCode(formattedString, {
40
- justEscapeSquareBrackets: true
41
- });
24
+ tables.push(...getMarkdownTables(formattedString));
42
25
  } catch (error) {
43
- console.warn('[@chayns-components/format] Warning: Failed to escape bb-code brackets', error);
26
+ console.warn('[@chayns-components/format] Warning: Failed to get markdown tables', error);
44
27
  }
45
28
  }
46
29
 
47
- // Parses markdown to HTML. Markdown tables are parsed separately.
30
+ // Escape HTML entities.
31
+ formattedString = escapeHtmlInText(formattedString);
32
+
33
+ // Escape BB-Code, to prevent conflicts between markdown and bb-code. Specifically [b]test[/b]() would be a problem, since markdown interprets parts of this as a link.
34
+
35
+ // Parses markdown to HTML.
48
36
  if (parseMarkdownOption) {
49
37
  try {
50
- formattedString = parseMarkdown(formattedString);
51
- } catch (error) {
52
- console.warn('[@chayns-components/format] Warning: Failed to parse markdown', error);
53
- }
54
- }
55
- const tables = [];
38
+ if (parseBBCodeOption) {
39
+ // Escapes BB-Code brackets.
40
+ formattedString = parseBBCode(formattedString, {
41
+ customInlineLevelBBCodeTags,
42
+ customBlockLevelBBCodeTags,
43
+ justEscapeSquareBrackets: true
44
+ });
45
+ }
46
+ formattedString = parseMarkdown(formattedString, parseBBCodeOption);
56
47
 
57
- // Parses markdown tables to HTML. Also returns the tables content as an array, to allow further processing.
58
- if (parseMarkdownTablesOption) {
59
- try {
60
- const result = parseMarkdownTables(formattedString);
61
- formattedString = result.html;
62
- tables.push(...result.tables);
48
+ // Remove trailing \n
49
+ formattedString = formattedString.replace(/\n$/, '');
50
+ if (parseBBCodeOption) {
51
+ // Unescapes BB-Code brackets.
52
+ formattedString = unescapeBBCodeSquareBrackets(formattedString);
53
+ }
63
54
  } catch (error) {
64
- console.warn('[@chayns-components/format] Warning: Failed to parse markdown tables', error);
55
+ console.warn('[@chayns-components/format] Warning: Failed to parse markdown', error);
65
56
  }
66
57
  }
67
58
 
68
- // Unescapes BB-Code square brackets, to allow parsing of BB-Code.
69
- if (shouldTemporarilyEscapeBBCodeBrackets) {
70
- formattedString = unescapeSquareBrackets(formattedString);
71
- }
59
+ // Parses BB-Code to HTML.
72
60
  if (parseBBCodeOption) {
73
61
  try {
74
62
  formattedString = parseBBCode(formattedString, {
75
63
  customInlineLevelBBCodeTags,
76
- customBlockLevelBBCodeTags,
77
- justEscapeSquareBrackets: false
64
+ customBlockLevelBBCodeTags
78
65
  });
66
+ formattedString = unescapeBBCodeSquareBrackets(formattedString);
79
67
  } catch (error) {
80
68
  console.warn('[@chayns-components/format] Warning: Failed to parse bb-code', error);
81
69
  }
@@ -1 +1 @@
1
- {"version":3,"file":"formatString.js","names":["escapeHtmlInText","unescapeSquareBrackets","parseBBCode","parseMarkdown","parseMarkdownTables","formatStringToHtml","string","options","html","tables","escapeHtml","escapeHtmlOption","parseMarkdownOption","parseMarkdownTablesOption","parseBBCodeOption","customInlineLevelBBCodeTags","customBlockLevelBBCodeTags","formattedString","shouldTemporarilyEscapeBBCodeBrackets","justEscapeSquareBrackets","error","console","warn","result","push"],"sources":["../../../../src/utils/formatString/formatString.ts"],"sourcesContent":["import { escapeHtmlInText, unescapeSquareBrackets } from '../escape';\nimport { parseBBCode, ParseBBCodesOptions } from './bb-code/formatBBCode';\nimport { parseMarkdown } from './markdown/formatMarkdown';\nimport { parseMarkdownTables, TableObject } from './markdown/formatMarkdownTable';\n\ninterface FormatStringOptions extends ParseBBCodesOptions {\n escapeHtml?: boolean;\n parseMarkdown?: boolean;\n parseMarkdownTables?: boolean;\n parseBBCode?: boolean;\n}\n\ninterface FormatStringResult {\n html: string;\n tables: TableObject[];\n}\n\n// This function takes a string and returns formatted html as a string.\nexport const formatStringToHtml = (\n string: string,\n options?: FormatStringOptions,\n): FormatStringResult => {\n if (!string) {\n return {\n html: '',\n tables: [],\n };\n }\n\n const {\n escapeHtml: escapeHtmlOption = false,\n parseMarkdown: parseMarkdownOption = true,\n parseMarkdownTables: parseMarkdownTablesOption = false,\n parseBBCode: parseBBCodeOption = false,\n customInlineLevelBBCodeTags = [],\n customBlockLevelBBCodeTags = [],\n } = options || {};\n\n let formattedString = string;\n\n // Escapes HTML.\n if (escapeHtmlOption) {\n formattedString = escapeHtmlInText(formattedString);\n }\n\n // Escape BB-Code square brackets, to prevent conflicts between markdown and BB Code.\n /* Conflict example:\n When Sidekick detects a function call as an entity through NER, then the following text is returned.\n '[nerReplace <params>]function[/nerReplace](<params>)'\n Because '[/nerReplace](<params>)' is a valid Markdown link, the Markdown parser would interpret it as a link\n and thus prevent the BB-Code parser from recognizing the BB-Code. Parsing the BB-Code first would prevent this\n issue. Unfortunately the Markdown parser doesn't support this.\n */\n const shouldTemporarilyEscapeBBCodeBrackets = parseMarkdownOption && parseBBCodeOption;\n if (shouldTemporarilyEscapeBBCodeBrackets) {\n try {\n formattedString = parseBBCode(formattedString, {\n justEscapeSquareBrackets: true,\n });\n } catch (error) {\n console.warn(\n '[@chayns-components/format] Warning: Failed to escape bb-code brackets',\n error,\n );\n }\n }\n\n // Parses markdown to HTML. Markdown tables are parsed separately.\n if (parseMarkdownOption) {\n try {\n formattedString = parseMarkdown(formattedString);\n } catch (error) {\n console.warn('[@chayns-components/format] Warning: Failed to parse markdown', error);\n }\n }\n\n const tables: TableObject[] = [];\n\n // Parses markdown tables to HTML. Also returns the tables content as an array, to allow further processing.\n if (parseMarkdownTablesOption) {\n try {\n const result = parseMarkdownTables(formattedString);\n formattedString = result.html;\n tables.push(...result.tables);\n } catch (error) {\n console.warn(\n '[@chayns-components/format] Warning: Failed to parse markdown tables',\n error,\n );\n }\n }\n\n // Unescapes BB-Code square brackets, to allow parsing of BB-Code.\n if (shouldTemporarilyEscapeBBCodeBrackets) {\n formattedString = unescapeSquareBrackets(formattedString);\n }\n\n if (parseBBCodeOption) {\n try {\n formattedString = parseBBCode(formattedString, {\n customInlineLevelBBCodeTags,\n customBlockLevelBBCodeTags,\n justEscapeSquareBrackets: false,\n });\n } catch (error) {\n console.warn('[@chayns-components/format] Warning: Failed to parse bb-code', error);\n }\n }\n\n return {\n html: formattedString,\n tables,\n };\n};\n"],"mappings":"AAAA,SAASA,gBAAgB,EAAEC,sBAAsB,QAAQ,WAAW;AACpE,SAASC,WAAW,QAA6B,wBAAwB;AACzE,SAASC,aAAa,QAAQ,2BAA2B;AACzD,SAASC,mBAAmB,QAAqB,gCAAgC;AAcjF;AACA,OAAO,MAAMC,kBAAkB,GAAGA,CAC9BC,MAAc,EACdC,OAA6B,KACR;EACrB,IAAI,CAACD,MAAM,EAAE;IACT,OAAO;MACHE,IAAI,EAAE,EAAE;MACRC,MAAM,EAAE;IACZ,CAAC;EACL;EAEA,MAAM;IACFC,UAAU,EAAEC,gBAAgB,GAAG,KAAK;IACpCR,aAAa,EAAES,mBAAmB,GAAG,IAAI;IACzCR,mBAAmB,EAAES,yBAAyB,GAAG,KAAK;IACtDX,WAAW,EAAEY,iBAAiB,GAAG,KAAK;IACtCC,2BAA2B,GAAG,EAAE;IAChCC,0BAA0B,GAAG;EACjC,CAAC,GAAGT,OAAO,IAAI,CAAC,CAAC;EAEjB,IAAIU,eAAe,GAAGX,MAAM;;EAE5B;EACA,IAAIK,gBAAgB,EAAE;IAClBM,eAAe,GAAGjB,gBAAgB,CAACiB,eAAe,CAAC;EACvD;;EAEA;EACA;AACJ;AACA;AACA;AACA;AACA;AACA;EACI,MAAMC,qCAAqC,GAAGN,mBAAmB,IAAIE,iBAAiB;EACtF,IAAII,qCAAqC,EAAE;IACvC,IAAI;MACAD,eAAe,GAAGf,WAAW,CAACe,eAAe,EAAE;QAC3CE,wBAAwB,EAAE;MAC9B,CAAC,CAAC;IACN,CAAC,CAAC,OAAOC,KAAK,EAAE;MACZC,OAAO,CAACC,IAAI,CACR,wEAAwE,EACxEF,KACJ,CAAC;IACL;EACJ;;EAEA;EACA,IAAIR,mBAAmB,EAAE;IACrB,IAAI;MACAK,eAAe,GAAGd,aAAa,CAACc,eAAe,CAAC;IACpD,CAAC,CAAC,OAAOG,KAAK,EAAE;MACZC,OAAO,CAACC,IAAI,CAAC,+DAA+D,EAAEF,KAAK,CAAC;IACxF;EACJ;EAEA,MAAMX,MAAqB,GAAG,EAAE;;EAEhC;EACA,IAAII,yBAAyB,EAAE;IAC3B,IAAI;MACA,MAAMU,MAAM,GAAGnB,mBAAmB,CAACa,eAAe,CAAC;MACnDA,eAAe,GAAGM,MAAM,CAACf,IAAI;MAC7BC,MAAM,CAACe,IAAI,CAAC,GAAGD,MAAM,CAACd,MAAM,CAAC;IACjC,CAAC,CAAC,OAAOW,KAAK,EAAE;MACZC,OAAO,CAACC,IAAI,CACR,sEAAsE,EACtEF,KACJ,CAAC;IACL;EACJ;;EAEA;EACA,IAAIF,qCAAqC,EAAE;IACvCD,eAAe,GAAGhB,sBAAsB,CAACgB,eAAe,CAAC;EAC7D;EAEA,IAAIH,iBAAiB,EAAE;IACnB,IAAI;MACAG,eAAe,GAAGf,WAAW,CAACe,eAAe,EAAE;QAC3CF,2BAA2B;QAC3BC,0BAA0B;QAC1BG,wBAAwB,EAAE;MAC9B,CAAC,CAAC;IACN,CAAC,CAAC,OAAOC,KAAK,EAAE;MACZC,OAAO,CAACC,IAAI,CAAC,8DAA8D,EAAEF,KAAK,CAAC;IACvF;EACJ;EAEA,OAAO;IACHZ,IAAI,EAAES,eAAe;IACrBR;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"formatString.js","names":["escapeHtmlInText","parseBBCode","unescapeBBCodeSquareBrackets","getMarkdownTables","parseMarkdown","formatStringToHtml","string","options","html","tables","parseMarkdownOption","parseBBCodeOption","customInlineLevelBBCodeTags","customBlockLevelBBCodeTags","formattedString","push","error","console","warn","justEscapeSquareBrackets","replace"],"sources":["../../../../src/utils/formatString/formatString.ts"],"sourcesContent":["import type { TableObject } from '../../types/format';\nimport { escapeHtmlInText } from '../escape';\nimport {\n parseBBCode,\n ParseBBCodesOptions,\n unescapeBBCodeSquareBrackets,\n} from './bb-code/formatBBCode';\nimport { getMarkdownTables, parseMarkdown } from './markdown/formatMarkdown';\n\ninterface FormatStringOptions extends ParseBBCodesOptions {\n parseMarkdown?: boolean;\n parseBBCode?: boolean;\n}\n\ninterface FormatStringResult {\n html: string;\n tables: TableObject[];\n}\n\n// This function takes a string and returns formatted html as a string.\nexport const formatStringToHtml = (\n string: string,\n options?: FormatStringOptions,\n): FormatStringResult => {\n if (!string) {\n return {\n html: '',\n tables: [],\n };\n }\n\n const {\n parseMarkdown: parseMarkdownOption = true,\n parseBBCode: parseBBCodeOption = false,\n customInlineLevelBBCodeTags = [],\n customBlockLevelBBCodeTags = [],\n } = options || {};\n\n let formattedString = string;\n\n // Needs to get the tables before escaping html and parsing bb-code, so the original content can be extracted.\n const tables: TableObject[] = [];\n if (parseMarkdownOption) {\n try {\n tables.push(...getMarkdownTables(formattedString));\n } catch (error) {\n console.warn(\n '[@chayns-components/format] Warning: Failed to get markdown tables',\n error,\n );\n }\n }\n\n // Escape HTML entities.\n formattedString = escapeHtmlInText(formattedString);\n\n // Escape BB-Code, to prevent conflicts between markdown and bb-code. Specifically [b]test[/b]() would be a problem, since markdown interprets parts of this as a link.\n\n // Parses markdown to HTML.\n if (parseMarkdownOption) {\n try {\n if (parseBBCodeOption) {\n // Escapes BB-Code brackets.\n formattedString = parseBBCode(formattedString, {\n customInlineLevelBBCodeTags,\n customBlockLevelBBCodeTags,\n justEscapeSquareBrackets: true,\n });\n }\n\n formattedString = parseMarkdown(formattedString, parseBBCodeOption);\n\n // Remove trailing \\n\n formattedString = formattedString.replace(/\\n$/, '');\n\n if (parseBBCodeOption) {\n // Unescapes BB-Code brackets.\n formattedString = unescapeBBCodeSquareBrackets(formattedString);\n }\n } catch (error) {\n console.warn('[@chayns-components/format] Warning: Failed to parse markdown', error);\n }\n }\n\n // Parses BB-Code to HTML.\n if (parseBBCodeOption) {\n try {\n formattedString = parseBBCode(formattedString, {\n customInlineLevelBBCodeTags,\n customBlockLevelBBCodeTags,\n });\n formattedString = unescapeBBCodeSquareBrackets(formattedString);\n } catch (error) {\n console.warn('[@chayns-components/format] Warning: Failed to parse bb-code', error);\n }\n }\n\n return {\n html: formattedString,\n tables,\n };\n};\n"],"mappings":"AACA,SAASA,gBAAgB,QAAQ,WAAW;AAC5C,SACIC,WAAW,EAEXC,4BAA4B,QACzB,wBAAwB;AAC/B,SAASC,iBAAiB,EAAEC,aAAa,QAAQ,2BAA2B;AAY5E;AACA,OAAO,MAAMC,kBAAkB,GAAGA,CAC9BC,MAAc,EACdC,OAA6B,KACR;EACrB,IAAI,CAACD,MAAM,EAAE;IACT,OAAO;MACHE,IAAI,EAAE,EAAE;MACRC,MAAM,EAAE;IACZ,CAAC;EACL;EAEA,MAAM;IACFL,aAAa,EAAEM,mBAAmB,GAAG,IAAI;IACzCT,WAAW,EAAEU,iBAAiB,GAAG,KAAK;IACtCC,2BAA2B,GAAG,EAAE;IAChCC,0BAA0B,GAAG;EACjC,CAAC,GAAGN,OAAO,IAAI,CAAC,CAAC;EAEjB,IAAIO,eAAe,GAAGR,MAAM;;EAE5B;EACA,MAAMG,MAAqB,GAAG,EAAE;EAChC,IAAIC,mBAAmB,EAAE;IACrB,IAAI;MACAD,MAAM,CAACM,IAAI,CAAC,GAAGZ,iBAAiB,CAACW,eAAe,CAAC,CAAC;IACtD,CAAC,CAAC,OAAOE,KAAK,EAAE;MACZC,OAAO,CAACC,IAAI,CACR,oEAAoE,EACpEF,KACJ,CAAC;IACL;EACJ;;EAEA;EACAF,eAAe,GAAGd,gBAAgB,CAACc,eAAe,CAAC;;EAEnD;;EAEA;EACA,IAAIJ,mBAAmB,EAAE;IACrB,IAAI;MACA,IAAIC,iBAAiB,EAAE;QACnB;QACAG,eAAe,GAAGb,WAAW,CAACa,eAAe,EAAE;UAC3CF,2BAA2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