@chayns-components/format 5.0.0-beta.1156 → 5.0.0-beta.1162

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.
@@ -104,7 +104,7 @@ const removeLinebreaks = text => text.replace(/\n/g, '');
104
104
  });
105
105
  (0, _vitest.test)('should format lists correctly', () => {
106
106
  const expectedUnorderedListResult = '<ul>\n<li>Item 1</li>\n<li>Item 2</li>\n<li>Item 3</li>\n</ul>';
107
- const expectedOrderedListResult = '<ol>\n<li>Item 1</li>\n<li>Item 2</li>\n<li>Item 3</li>\n</ol>';
107
+ const expectedOrderedListResult = '<ol>\n<li value="1">Item 1</li>\n<li value="2">Item 2</li>\n<li value="3">Item 3</li>\n</ol>';
108
108
  const unorderedListResult1 = (0, _formatString.formatStringToHtml)('- Item 1\n- Item 2\n- Item 3');
109
109
  (0, _vitest.expect)(unorderedListResult1.html).toEqual(expectedUnorderedListResult);
110
110
  (0, _vitest.expect)(unorderedListResult1.tables).toEqual([]);
@@ -1 +1 @@
1
- {"version":3,"file":"formatString.test.js","names":["_vitest","require","_formatString","removeLinebreaks","text","replace","describe","test","result","formatStringToHtml","expect","html","toEqual","tables","resultEscape","resultEscape1","resultEscape2","boldResult","italicResult","inlineCodeResult","h1Result","h2Result","h3Result","h4Result","h5Result","h6Result","expectedUnorderedListResult","expectedOrderedListResult","unorderedListResult1","unorderedListResult2","orderedListResult","orderedListResult2","expectedThematicBreakResult","result1","result2","resultWithoutLanguage","resultWithLanguage","inputString","csv","raw","id","parseBBCode","table1","getTable1Result","index","table1Csv","table2","getTable2TResult","table2Csv","getHeadingInput","tag","getHeadingOutput","headingTags","forEach","input","output","customInlineLevelBBCodeTags","customBlockLevelBBCodeTags"],"sources":["../../../../src/utils/formatString/formatString.test.ts"],"sourcesContent":["import { describe, expect, test } from 'vitest';\nimport { formatStringToHtml } from './formatString';\n\nconst removeLinebreaks = (text: string) => text.replace(/\\n/g, '');\n\ndescribe('HTML Formatter Function', () => {\n describe('Format Plain Text', () => {\n describe('Line breaks', () => {\n test('should format line breaks correctly', () => {\n const result = formatStringToHtml('Line 1\\nLine 2');\n expect(result.html).toEqual('<p>Line 1\\nLine 2</p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format multiple line breaks correctly', () => {\n const result = formatStringToHtml('Line 1\\n\\nLine 2');\n expect(result.html).toEqual('<p>Line 1</p>\\n<p>Line 2</p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should remove trailing and leading new lines', () => {\n const result = formatStringToHtml('\\n\\n\\nLine 1\\n\\n\\n');\n expect(result.html).toEqual('<p>Line 1</p>');\n expect(result.tables).toEqual([]);\n });\n });\n\n describe('Whitespaces', () => {\n test('should not remove repeated whitespaces', () => {\n const result = formatStringToHtml('Text with spaces');\n expect(result.html).toEqual('<p>Text with spaces</p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should not remove leading and trailing whitespaces', () => {\n const result = formatStringToHtml(' Text ');\n expect(result.html).toEqual('<p> Text </p>');\n expect(result.tables).toEqual([]);\n });\n });\n\n describe('HTML', () => {\n test('should escape < and > correctly', () => {\n const resultEscape = formatStringToHtml('<div>Test</div>');\n expect(resultEscape.html).toEqual('<p>&lt;div&gt;Test&lt;/div&gt;</p>');\n expect(resultEscape.tables).toEqual([]);\n });\n\n test('should not escape &', () => {\n const resultEscape1 = formatStringToHtml('&lt;div&gt;Test&lt;/div&gt;');\n expect(resultEscape1.html).toEqual('<p>&lt;div&gt;Test&lt;/div&gt;</p>');\n expect(resultEscape1.tables).toEqual([]);\n\n const resultEscape2 = formatStringToHtml(\n '&amp;lt;div&amp;gt;Test&amp;lt;/div&amp;gt;',\n );\n expect(resultEscape2.html).toEqual(\n '<p>&amp;lt;div&amp;gt;Test&amp;lt;/div&amp;gt;</p>',\n );\n expect(resultEscape2.tables).toEqual([]);\n });\n\n // TODO Decide if & should be escaped, when they are not part of an HTML entity.\n });\n\n describe('URLs', () => {\n test('should not format URLs', () => {\n const result = formatStringToHtml('https://example.com');\n expect(result.html).toEqual('<p>https://example.com</p>');\n expect(result.tables).toEqual([]);\n });\n });\n });\n\n describe('Format Markdown', () => {\n describe('All Elements', () => {\n test('should format text styling correctly', () => {\n const boldResult = formatStringToHtml('**bold**');\n expect(boldResult.html).toEqual('<p><strong>bold</strong></p>');\n expect(boldResult.tables).toEqual([]);\n\n const italicResult = formatStringToHtml('*italic*');\n expect(italicResult.html).toEqual('<p><em>italic</em></p>');\n expect(italicResult.tables).toEqual([]);\n\n const inlineCodeResult = formatStringToHtml('`inline code`');\n expect(inlineCodeResult.html).toEqual('<p><code>inline code</code></p>');\n expect(inlineCodeResult.tables).toEqual([]);\n });\n\n test('should format headings correctly', () => {\n const h1Result = formatStringToHtml('# h1');\n expect(h1Result.html).toEqual('<h1>h1</h1>');\n expect(h1Result.tables).toEqual([]);\n\n const h2Result = formatStringToHtml('## h2');\n expect(h2Result.html).toEqual('<h2>h2</h2>');\n expect(h2Result.tables).toEqual([]);\n\n const h3Result = formatStringToHtml('### h3');\n expect(h3Result.html).toEqual('<h3>h3</h3>');\n expect(h3Result.tables).toEqual([]);\n\n const h4Result = formatStringToHtml('#### h4');\n expect(h4Result.html).toEqual('<h4>h4</h4>');\n expect(h4Result.tables).toEqual([]);\n\n const h5Result = formatStringToHtml('##### h5');\n expect(h5Result.html).toEqual('<h5>h5</h5>');\n expect(h5Result.tables).toEqual([]);\n\n const h6Result = formatStringToHtml('###### h6');\n expect(h6Result.html).toEqual('<h6>h6</h6>');\n expect(h6Result.tables).toEqual([]);\n });\n\n test('should format links correctly', () => {\n const result = formatStringToHtml('[Link](https://example.com)');\n expect(result.html).toEqual('<p><a href=\"https://example.com\">Link</a></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format images correctly', () => {\n const result = formatStringToHtml('![Alt Text](https://example.com/image.jpg)');\n expect(result.html).toEqual(\n '<p><img src=\"https://example.com/image.jpg\" alt=\"Alt Text\"></p>',\n );\n expect(result.tables).toEqual([]);\n });\n\n test('should format lists correctly', () => {\n const expectedUnorderedListResult =\n '<ul>\\n<li>Item 1</li>\\n<li>Item 2</li>\\n<li>Item 3</li>\\n</ul>';\n const expectedOrderedListResult =\n '<ol>\\n<li>Item 1</li>\\n<li>Item 2</li>\\n<li>Item 3</li>\\n</ol>';\n\n const unorderedListResult1 = formatStringToHtml('- Item 1\\n- Item 2\\n- Item 3');\n expect(unorderedListResult1.html).toEqual(expectedUnorderedListResult);\n expect(unorderedListResult1.tables).toEqual([]);\n\n const unorderedListResult2 = formatStringToHtml('* Item 1\\n* Item 2\\n* Item 3');\n expect(unorderedListResult2.html).toEqual(expectedUnorderedListResult);\n expect(unorderedListResult2.tables).toEqual([]);\n\n const orderedListResult = formatStringToHtml('1. Item 1\\n2. Item 2\\n3. Item 3');\n expect(orderedListResult.html).toEqual(expectedOrderedListResult);\n expect(orderedListResult.tables).toEqual([]);\n\n const orderedListResult2 = formatStringToHtml('1) Item 1\\n2) Item 2\\n3) Item 3');\n expect(orderedListResult2.html).toEqual(expectedOrderedListResult);\n expect(orderedListResult2.tables).toEqual([]);\n });\n\n test('should format thematic breaks correctly', () => {\n const expectedThematicBreakResult = '<hr>';\n\n const result1 = formatStringToHtml('---');\n expect(result1.html).toEqual(expectedThematicBreakResult);\n expect(result1.tables).toEqual([]);\n\n const result2 = formatStringToHtml('***');\n expect(result2.html).toEqual(expectedThematicBreakResult);\n expect(result2.tables).toEqual([]);\n });\n\n test('should format code blocks correctly', () => {\n const resultWithoutLanguage = formatStringToHtml('```\\nconst a = 1;\\n```');\n expect(resultWithoutLanguage.html).toEqual('<pre><code>const a = 1;</code></pre>');\n expect(resultWithoutLanguage.tables).toEqual([]);\n\n const resultWithLanguage = formatStringToHtml('```js\\nconst a = 1;\\n```');\n expect(resultWithLanguage.html).toEqual(\n '<pre><code class=\"language-js\">const a = 1;</code></pre>',\n );\n expect(resultWithLanguage.tables).toEqual([]);\n });\n\n test('should format tables correctly', () => {\n const inputString =\n '| Header 1 | Header 2 |\\n|----------|----------|\\n| Cell 1 | Cell 2 |';\n const result = formatStringToHtml(inputString);\n expect(removeLinebreaks(result.html)).toEqual(\n '<table id=\"formatted-table-0\"><thead><tr><th>Header 1</th><th>Header 2</th></tr></thead><tbody><tr><td>Cell 1</td><td>Cell 2</td></tr></tbody></table>',\n );\n expect(result.tables).toEqual([\n {\n csv: 'Header 1,Header 2\\nCell 1,Cell 2\\n',\n raw: inputString,\n id: 'formatted-table-0',\n },\n ]);\n });\n });\n\n describe('Inline Code', () => {\n describe('HTML In Code', () => {\n test('should escape < and > within inline code correctly', () => {\n const result1 = formatStringToHtml('`<div>Test</div>`');\n expect(result1.html).toEqual('<p><code>&lt;div&gt;Test&lt;/div&gt;</code></p>');\n expect(result1.tables).toEqual([]);\n });\n\n test('should not escape & within inline code', () => {\n const resultEscape1 = formatStringToHtml('`&lt;div&gt;Test&lt;/div&gt;`');\n expect(resultEscape1.html).toEqual(\n '<p><code>&lt;div&gt;Test&lt;/div&gt;</code></p>',\n );\n expect(resultEscape1.tables).toEqual([]);\n\n const resultEscape2 = formatStringToHtml(\n '`&amp;lt;div&amp;gt;Test&amp;lt;/div&amp;gt;`',\n );\n expect(resultEscape2.html).toEqual(\n '<p><code>&amp;lt;div&amp;gt;Test&amp;lt;/div&amp;gt;</code></p>',\n );\n expect(resultEscape2.tables).toEqual([]);\n });\n });\n\n test('should not format markdown within inline code', () => {\n const result = formatStringToHtml('`**bold** *italic*`');\n expect(result.html).toEqual('<p><code>**bold** *italic*</code></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should not format bb-code within inline code', () => {\n const result = formatStringToHtml('`[b]bold[/b]`', { parseBBCode: true });\n expect(result.html).toEqual('<p><code>[b]bold[/b]</code></p>');\n expect(result.tables).toEqual([]);\n });\n });\n\n describe('Codeblock', () => {\n test('should format code blocks with multiple lines correctly', () => {\n const resultWithoutLanguage = formatStringToHtml(\n '```\\nconst a = 1;\\nconst b = 2;\\n```',\n );\n expect(resultWithoutLanguage.html).toEqual(\n '<pre><code>const a = 1;\\nconst b = 2;</code></pre>',\n );\n expect(resultWithoutLanguage.tables).toEqual([]);\n\n const resultWithLanguage = formatStringToHtml(\n '```js\\nconst a = 1;\\nconst b = 2;\\n```',\n );\n expect(resultWithLanguage.html).toEqual(\n '<pre><code class=\"language-js\">const a = 1;\\nconst b = 2;</code></pre>',\n );\n expect(resultWithLanguage.tables).toEqual([]);\n });\n\n test('should not format 4 spaces as code block', () => {\n const result = formatStringToHtml(' const a = 1;');\n expect(result.html).toEqual('<p> const a = 1;</p>');\n expect(result.tables).toEqual([]);\n });\n\n describe('HTML In Code', () => {\n test('should escape < and > within code block', () => {\n const resultWithoutLanguage = formatStringToHtml('```\\n<div>Test</div>\\n```');\n expect(resultWithoutLanguage.html).toEqual(\n '<pre><code>&lt;div&gt;Test&lt;/div&gt;</code></pre>',\n );\n expect(resultWithoutLanguage.tables).toEqual([]);\n\n const resultWithLanguage = formatStringToHtml('```html\\n<div>Test</div>\\n```');\n expect(resultWithLanguage.html).toEqual(\n '<pre><code class=\"language-html\">&lt;div&gt;Test&lt;/div&gt;</code></pre>',\n );\n expect(resultWithLanguage.tables).toEqual([]);\n });\n\n test('should not escape & within code block', () => {\n const resultEscape1 = formatStringToHtml(\n '```\\n&lt;div&gt;Test&lt;/div&gt;\\n```',\n );\n expect(resultEscape1.html).toEqual(\n '<pre><code>&lt;div&gt;Test&lt;/div&gt;</code></pre>',\n );\n expect(resultEscape1.tables).toEqual([]);\n\n const resultEscape2 = formatStringToHtml(\n '```\\n&amp;lt;div&amp;gt;Test&amp;lt;/div&amp;gt;\\n```',\n );\n expect(resultEscape2.html).toEqual(\n '<pre><code>&amp;lt;div&amp;gt;Test&amp;lt;/div&amp;gt;</code></pre>',\n );\n expect(resultEscape2.tables).toEqual([]);\n });\n });\n\n test('should not format markdown within code block', () => {\n const resultWithoutLanguage = formatStringToHtml('```\\n**Test**\\n```');\n expect(resultWithoutLanguage.html).toEqual('<pre><code>**Test**</code></pre>');\n expect(resultWithoutLanguage.tables).toEqual([]);\n\n const resultWithLanguage = formatStringToHtml('```html\\n**Test**\\n```');\n expect(resultWithLanguage.html).toEqual(\n '<pre><code class=\"language-html\">**Test**</code></pre>',\n );\n expect(resultWithLanguage.tables).toEqual([]);\n });\n\n test('should not format bb-code within code block', () => {\n const resultWithoutLanguage = formatStringToHtml('```\\n[b]Test[/b]\\n```');\n expect(resultWithoutLanguage.html).toEqual('<pre><code>[b]Test[/b]</code></pre>');\n expect(resultWithoutLanguage.tables).toEqual([]);\n\n const resultWithLanguage = formatStringToHtml('```html\\n[b]Test[/b]\\n```');\n expect(resultWithLanguage.html).toEqual(\n '<pre><code class=\"language-html\">[b]Test[/b]</code></pre>',\n );\n expect(resultWithLanguage.tables).toEqual([]);\n });\n });\n\n describe('Table', () => {\n test('should format markdown within table correctly', () => {\n const inputString =\n '| Header 1 | Header 2 |\\n|----------|----------|\\n| **Cell 1** | *Cell 2* |';\n const result = formatStringToHtml(inputString);\n expect(removeLinebreaks(result.html)).toEqual(\n '<table id=\"formatted-table-0\"><thead><tr><th>Header 1</th><th>Header 2</th></tr></thead><tbody><tr><td><strong>Cell 1</strong></td><td><em>Cell 2</em></td></tr></tbody></table>',\n );\n expect(result.tables).toEqual([\n {\n csv: 'Header 1,Header 2\\n**Cell 1**,*Cell 2*\\n',\n raw: inputString,\n id: 'formatted-table-0',\n },\n ]);\n });\n\n test('should format bb-code within table correctly', () => {\n const inputString =\n '| Header 1 | Header 2 |\\n|----------|----------|\\n| [b]Cell 1[/b] | [i]Cell 2[/i] |';\n const result = formatStringToHtml(inputString, {\n parseBBCode: true,\n });\n expect(removeLinebreaks(result.html)).toEqual(\n '<table id=\"formatted-table-0\"><thead><tr><th>Header 1</th><th>Header 2</th></tr></thead><tbody><tr><td><b>Cell 1</b></td><td><i>Cell 2</i></td></tr></tbody></table>',\n );\n expect(result.tables).toEqual([\n {\n csv: 'Header 1,Header 2\\n[b]Cell 1[/b],[i]Cell 2[/i]\\n',\n raw: inputString,\n id: 'formatted-table-0',\n },\n ]);\n });\n\n test('should format html within table correctly', () => {\n const inputString =\n '| Header 1 | Header 2 | Header 3 |\\n|----------|----------|----------|\\n| <div>Cell 1</div> | &lt;div&gt;Cell 2&lt;/div&gt; | &amp;lt;div&amp;gt;Cell 3&amp;lt;/div&amp;gt; |';\n const result = formatStringToHtml(inputString, {\n parseBBCode: true,\n });\n expect(removeLinebreaks(result.html)).toEqual(\n '<table id=\"formatted-table-0\"><thead><tr><th>Header 1</th><th>Header 2</th><th>Header 3</th></tr></thead><tbody><tr><td>&lt;div&gt;Cell 1&lt;/div&gt;</td><td>&lt;div&gt;Cell 2&lt;/div&gt;</td><td>&amp;lt;div&amp;gt;Cell 3&amp;lt;/div&amp;gt;</td></tr></tbody></table>',\n );\n expect(result.tables).toEqual([\n {\n csv: 'Header 1,Header 2,Header 3\\n<div>Cell 1</div>,<div>Cell 2</div>,&lt;div&gt;Cell 3&lt;/div&gt;\\n',\n raw: '| Header 1 | Header 2 | Header 3 |\\n|----------|----------|----------|\\n| <div>Cell 1</div> | <div>Cell 2</div> | &lt;div&gt;Cell 3&lt;/div&gt; |',\n id: 'formatted-table-0',\n },\n ]);\n });\n\n test('should format multiple tables correctly', () => {\n const table1 =\n '| Header 1 | Header 2 |\\n|----------|----------|\\n| Cell 1 | Cell 2 |';\n const getTable1Result = (index: number) =>\n `<table id=\"formatted-table-${index}\"><thead><tr><th>Header 1</th><th>Header 2</th></tr></thead><tbody><tr><td>Cell 1</td><td>Cell 2</td></tr></tbody></table>`;\n const table1Csv = 'Header 1,Header 2\\nCell 1,Cell 2\\n';\n const table2 =\n '| Header 3 | Header 4 |\\n|----------|----------|\\n| Cell 3 | Cell 4 |';\n const getTable2TResult = (index: number) =>\n `<table id=\"formatted-table-${index}\"><thead><tr><th>Header 3</th><th>Header 4</th></tr></thead><tbody><tr><td>Cell 3</td><td>Cell 4</td></tr></tbody></table>`;\n const table2Csv = 'Header 3,Header 4\\nCell 3,Cell 4\\n';\n\n const result1 = formatStringToHtml(`${table1}\\n\\n${table2}`);\n expect(removeLinebreaks(result1.html)).toEqual(\n `${getTable1Result(0)}${getTable2TResult(1)}`,\n );\n expect(result1.tables).toEqual([\n {\n csv: table1Csv,\n raw: `${table1}\\n\\n`,\n id: 'formatted-table-0',\n },\n {\n csv: table2Csv,\n raw: table2,\n id: 'formatted-table-1',\n },\n ]);\n\n // Tables in reverse order.\n const result2 = formatStringToHtml(`${table2}\\n\\n${table1}`);\n expect(removeLinebreaks(result2.html)).toEqual(\n `${getTable2TResult(0)}${getTable1Result(1)}`,\n );\n expect(result2.tables).toEqual([\n {\n csv: table2Csv,\n raw: `${table2}\\n\\n`,\n id: 'formatted-table-0',\n },\n {\n csv: table1Csv,\n raw: table1,\n id: 'formatted-table-1',\n },\n ]);\n });\n });\n\n describe('List', () => {\n test('should format markdown within list correctly', () => {\n const result = formatStringToHtml('- **Item 1**\\n- *Item 2*');\n expect(removeLinebreaks(result.html)).toEqual(\n '<ul><li><strong>Item 1</strong></li><li><em>Item 2</em></li></ul>',\n );\n expect(result.tables).toEqual([]);\n });\n\n test('should format task lists correctly', () => {\n const result1 = formatStringToHtml('- [ ] 1\\n- [x] 2\\n- [X] 3');\n expect(removeLinebreaks(result1.html)).toEqual(\n '<ul><li>[ ] 1</li><li>[x] 2</li><li>[x] 3</li></ul>',\n );\n expect(result1.tables).toEqual([]);\n });\n });\n\n describe('Combined Elements', () => {\n test('should format code block within list correctly', () => {\n const result = formatStringToHtml('* test\\n ```\\n test\\n ```');\n expect(removeLinebreaks(result.html)).toEqual(\n '<ul><li>test<pre><code>test</code></pre></li></ul>',\n );\n expect(result.tables).toEqual([]);\n });\n });\n\n describe('Conflicts with BB-Code', () => {\n test('should not format bb code tag followed by paranthese to link', () => {\n const result = formatStringToHtml('[b]bold[/b](test)', { parseBBCode: true });\n expect(result.html).toEqual('<p><b>bold</b>(test)</p>');\n expect(result.tables).toEqual([]);\n });\n });\n });\n\n describe('Format BB-Code', () => {\n describe('All Elements', () => {\n describe('Inline Elements', () => {\n // b, strong, i, em, u, s, span, img\n test('should format b tag correctly', () => {\n const result = formatStringToHtml('[b]bold[/b]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><b>bold</b></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format strong tag correctly', () => {\n const result = formatStringToHtml('[strong]bold[/strong]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><strong>bold</strong></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format i tag correctly', () => {\n const result = formatStringToHtml('[i]italic[/i]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><i>italic</i></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format em tag correctly', () => {\n const result = formatStringToHtml('[em]italic[/em]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><em>italic</em></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format u tag correctly', () => {\n const result = formatStringToHtml('[u]underline[/u]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><u>underline</u></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format s tag correctly', () => {\n const result = formatStringToHtml('[s]strike[/s]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><s>strike</s></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format span tag correctly', () => {\n const result = formatStringToHtml('[span]span[/span]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><span>span</span></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format img tag correctly', () => {\n const result = formatStringToHtml(\n '[img src=\"https://example.com/image.jpg\"][/img]',\n {\n parseBBCode: true,\n },\n );\n expect(result.html).toEqual('<p><img src=\"https://example.com/image.jpg\"></p>');\n expect(result.tables).toEqual([]);\n });\n });\n\n describe('Block Level Elements', () => {\n test('should format center tag correctly', () => {\n const result = formatStringToHtml('[center]centered text[/center]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><center>centered text</center></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format ul tag correctly', () => {\n const result = formatStringToHtml('[ul][li]Item 1[/li][li]Item 2[/li][/ul]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><ul><li>Item 1</li><li>Item 2</li></ul></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format ol tag correctly', () => {\n const result = formatStringToHtml('[ol][li]Item 1[/li][li]Item 2[/li][/ol]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><ol><li>Item 1</li><li>Item 2</li></ol></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format li tag correctly', () => {\n const result = formatStringToHtml('[li]Item[/li]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><li>Item</li></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format heading tags correctly', () => {\n const getHeadingInput = (tag: string) => `[${tag}]${tag}[/${tag}]`;\n const getHeadingOutput = (tag: string) => `<p><${tag}>${tag}</${tag}></p>`;\n const headingTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];\n\n headingTags.forEach((tag) => {\n const result = formatStringToHtml(getHeadingInput(tag), {\n parseBBCode: true,\n });\n expect(result.html).toEqual(getHeadingOutput(tag));\n expect(result.tables).toEqual([]);\n });\n });\n\n test('should format p tag correctly', () => {\n const result = formatStringToHtml('[p]paragraph[/p]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><p>paragraph</p></p>');\n expect(result.tables).toEqual([]);\n });\n });\n\n describe('Custom Elements', () => {\n test('should format custom tags correctly', () => {\n const input = '[custom attribute1=\"test1\" attribute2=\"test2\"]custom[/custom]';\n const output =\n '<p><bb-code-custom attribute1=\"test1\" attribute2=\"test2\">custom</bb-code-custom></p>';\n const result1 = formatStringToHtml(input, {\n parseBBCode: true,\n customInlineLevelBBCodeTags: ['custom'],\n });\n expect(result1.html).toEqual(output);\n expect(result1.tables).toEqual([]);\n\n const result2 = formatStringToHtml(input, {\n parseBBCode: true,\n customBlockLevelBBCodeTags: ['custom'],\n });\n expect(result2.html).toEqual(output);\n expect(result2.tables).toEqual([]);\n });\n\n test('should not format unknown custom tags', () => {\n const result = formatStringToHtml('[unknown]unknown[/unknown]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p>[unknown]unknown[/unknown]</p>');\n expect(result.tables).toEqual([]);\n });\n });\n\n describe('Line breaks', () => {\n describe('Between Elements', () => {\n test('should format line breaks between block level elements correctly', () => {\n const result1 = formatStringToHtml('[h1]h1[/h1]\\n[h2]h2[/h2]', {\n parseBBCode: true,\n });\n expect(result1.html).toEqual('<p><h1>h1</h1><h2>h2</h2></p>');\n expect(result1.tables).toEqual([]);\n\n const result2 = formatStringToHtml('[h1]h1[/h1]\\n\\n[h2]h2[/h2]', {\n parseBBCode: true,\n });\n expect(result2.html).toEqual('<p><h1>h1</h1></p>\\n<p><h2>h2</h2></p>');\n expect(result2.tables).toEqual([]);\n });\n\n test('should format line breaks between inline elements correctly', () => {\n const result1 = formatStringToHtml('[b]bold[/b]\\n[i]italic[/i]', {\n parseBBCode: true,\n });\n expect(result1.html).toEqual('<p><b>bold</b>\\n<i>italic</i></p>');\n expect(result1.tables).toEqual([]);\n\n const result2 = formatStringToHtml('[b]bold[/b]\\n\\n[i]italic[/i]', {\n parseBBCode: true,\n });\n expect(result2.html).toEqual('<p><b>bold</b></p>\\n<p><i>italic</i></p>');\n expect(result2.tables).toEqual([]);\n });\n });\n\n describe('Within Elements', () => {\n test('should format line breaks within block level elements correctly', () => {\n const result = formatStringToHtml('[h1]Line 1\\nLine 2[/h1]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><h1>Line 1\\nLine 2</h1></p>');\n expect(result.tables).toEqual([]);\n });\n\n // This is a test that would fail!\n // test('should format multiple line breaks within block level elements correctly', () => {\n // const result = formatStringToHtml('[h1]Line 1\\n\\nLine 2[/h1]', {\n // parseBBCode: true,\n // });\n // expect(result.html).toEqual('<p><h1>Line 1\\nLine 2</h1></p>');\n // expect(result.tables).toEqual([]);\n // });\n\n test('should remove trailing and leading new lines within block level elements', () => {\n const result = formatStringToHtml('[h1]\\n\\n\\nLine 1\\n\\n\\n[/h1]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><h1>Line 1</h1></p>');\n expect(result.tables).toEqual([]);\n });\n });\n });\n\n test('should not format url in tag attributes', () => {\n const result = formatStringToHtml(\n '[link url=\"https://www.google.com\"]Google[/link]',\n {\n parseBBCode: true,\n customInlineLevelBBCodeTags: ['link'],\n },\n );\n expect(result.html).toEqual(\n '<p><bb-code-link url=\"https://www.google.com\">Google</bb-code-link></p>',\n );\n expect(result.tables).toEqual([]);\n });\n\n test('should apply style attribute correctly', () => {\n const result = formatStringToHtml('[span style=\"color: red;\"]red text[/span]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><span style=\"color: red;\">red text</span></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format nested elements correctly', () => {\n const result = formatStringToHtml('[b][i]bold italic[/i][/b]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><b><i>bold italic</i></b></p>');\n expect(result.tables).toEqual([]);\n });\n });\n });\n\n describe('Combined Formatting (Markdown + BB-Code)', () => {\n test('should format bb-code within markdown correctly', () => {\n const result = formatStringToHtml('*[b]bold[/b]*', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><em><b>bold</b></em></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format markdown within bb-code correctly', () => {\n const result = formatStringToHtml('[b]*bold*[/b]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><b><em>bold</em></b></p>');\n expect(result.tables).toEqual([]);\n });\n });\n});\n"],"mappings":";;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAEA,MAAME,gBAAgB,GAAIC,IAAY,IAAKA,IAAI,CAACC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;AAElE,IAAAC,gBAAQ,EAAC,yBAAyB,EAAE,MAAM;EACtC,IAAAA,gBAAQ,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M,GAAG,IAAAC,gCAAkB,EAAC,eAAe,EAAE;QAC/CgC,WAAW,EAAE;MACjB,CAAC,CAAC;MACF,IAAA/B,cAAM,EAACF,MAAM,CAACG,IAAI,CAAC,CAACC,OAAO,CAAC,6BAA6B,CAAC;MAC1D,IAAAF,cAAM,EAACF,MAAM,CAACK,MAAM,CAAC,CAACD,OAAO,CAAC,EAAE,CAAC;IACrC,CAAC,CAAC;EACN,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"formatString.test.js","names":["_vitest","require","_formatString","removeLinebreaks","text","replace","describe","test","result","formatStringToHtml","expect","html","toEqual","tables","resultEscape","resultEscape1","resultEscape2","boldResult","italicResult","inlineCodeResult","h1Result","h2Result","h3Result","h4Result","h5Result","h6Result","expectedUnorderedListResult","expectedOrderedListResult","unorderedListResult1","unorderedListResult2","orderedListResult","orderedListResult2","expectedThematicBreakResult","result1","result2","resultWithoutLanguage","resultWithLanguage","inputString","csv","raw","id","parseBBCode","table1","getTable1Result","index","table1Csv","table2","getTable2TResult","table2Csv","getHeadingInput","tag","getHeadingOutput","headingTags","forEach","input","output","customInlineLevelBBCodeTags","customBlockLevelBBCodeTags"],"sources":["../../../../src/utils/formatString/formatString.test.ts"],"sourcesContent":["import { describe, expect, test } from 'vitest';\nimport { formatStringToHtml } from './formatString';\n\nconst removeLinebreaks = (text: string) => text.replace(/\\n/g, '');\n\ndescribe('HTML Formatter Function', () => {\n describe('Format Plain Text', () => {\n describe('Line breaks', () => {\n test('should format line breaks correctly', () => {\n const result = formatStringToHtml('Line 1\\nLine 2');\n expect(result.html).toEqual('<p>Line 1\\nLine 2</p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format multiple line breaks correctly', () => {\n const result = formatStringToHtml('Line 1\\n\\nLine 2');\n expect(result.html).toEqual('<p>Line 1</p>\\n<p>Line 2</p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should remove trailing and leading new lines', () => {\n const result = formatStringToHtml('\\n\\n\\nLine 1\\n\\n\\n');\n expect(result.html).toEqual('<p>Line 1</p>');\n expect(result.tables).toEqual([]);\n });\n });\n\n describe('Whitespaces', () => {\n test('should not remove repeated whitespaces', () => {\n const result = formatStringToHtml('Text with spaces');\n expect(result.html).toEqual('<p>Text with spaces</p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should not remove leading and trailing whitespaces', () => {\n const result = formatStringToHtml(' Text ');\n expect(result.html).toEqual('<p> Text </p>');\n expect(result.tables).toEqual([]);\n });\n });\n\n describe('HTML', () => {\n test('should escape < and > correctly', () => {\n const resultEscape = formatStringToHtml('<div>Test</div>');\n expect(resultEscape.html).toEqual('<p>&lt;div&gt;Test&lt;/div&gt;</p>');\n expect(resultEscape.tables).toEqual([]);\n });\n\n test('should not escape &', () => {\n const resultEscape1 = formatStringToHtml('&lt;div&gt;Test&lt;/div&gt;');\n expect(resultEscape1.html).toEqual('<p>&lt;div&gt;Test&lt;/div&gt;</p>');\n expect(resultEscape1.tables).toEqual([]);\n\n const resultEscape2 = formatStringToHtml(\n '&amp;lt;div&amp;gt;Test&amp;lt;/div&amp;gt;',\n );\n expect(resultEscape2.html).toEqual(\n '<p>&amp;lt;div&amp;gt;Test&amp;lt;/div&amp;gt;</p>',\n );\n expect(resultEscape2.tables).toEqual([]);\n });\n\n // TODO Decide if & should be escaped, when they are not part of an HTML entity.\n });\n\n describe('URLs', () => {\n test('should not format URLs', () => {\n const result = formatStringToHtml('https://example.com');\n expect(result.html).toEqual('<p>https://example.com</p>');\n expect(result.tables).toEqual([]);\n });\n });\n });\n\n describe('Format Markdown', () => {\n describe('All Elements', () => {\n test('should format text styling correctly', () => {\n const boldResult = formatStringToHtml('**bold**');\n expect(boldResult.html).toEqual('<p><strong>bold</strong></p>');\n expect(boldResult.tables).toEqual([]);\n\n const italicResult = formatStringToHtml('*italic*');\n expect(italicResult.html).toEqual('<p><em>italic</em></p>');\n expect(italicResult.tables).toEqual([]);\n\n const inlineCodeResult = formatStringToHtml('`inline code`');\n expect(inlineCodeResult.html).toEqual('<p><code>inline code</code></p>');\n expect(inlineCodeResult.tables).toEqual([]);\n });\n\n test('should format headings correctly', () => {\n const h1Result = formatStringToHtml('# h1');\n expect(h1Result.html).toEqual('<h1>h1</h1>');\n expect(h1Result.tables).toEqual([]);\n\n const h2Result = formatStringToHtml('## h2');\n expect(h2Result.html).toEqual('<h2>h2</h2>');\n expect(h2Result.tables).toEqual([]);\n\n const h3Result = formatStringToHtml('### h3');\n expect(h3Result.html).toEqual('<h3>h3</h3>');\n expect(h3Result.tables).toEqual([]);\n\n const h4Result = formatStringToHtml('#### h4');\n expect(h4Result.html).toEqual('<h4>h4</h4>');\n expect(h4Result.tables).toEqual([]);\n\n const h5Result = formatStringToHtml('##### h5');\n expect(h5Result.html).toEqual('<h5>h5</h5>');\n expect(h5Result.tables).toEqual([]);\n\n const h6Result = formatStringToHtml('###### h6');\n expect(h6Result.html).toEqual('<h6>h6</h6>');\n expect(h6Result.tables).toEqual([]);\n });\n\n test('should format links correctly', () => {\n const result = formatStringToHtml('[Link](https://example.com)');\n expect(result.html).toEqual('<p><a href=\"https://example.com\">Link</a></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format images correctly', () => {\n const result = formatStringToHtml('![Alt Text](https://example.com/image.jpg)');\n expect(result.html).toEqual(\n '<p><img src=\"https://example.com/image.jpg\" alt=\"Alt Text\"></p>',\n );\n expect(result.tables).toEqual([]);\n });\n\n test('should format lists correctly', () => {\n const expectedUnorderedListResult =\n '<ul>\\n<li>Item 1</li>\\n<li>Item 2</li>\\n<li>Item 3</li>\\n</ul>';\n const expectedOrderedListResult =\n '<ol>\\n<li value=\"1\">Item 1</li>\\n<li value=\"2\">Item 2</li>\\n<li value=\"3\">Item 3</li>\\n</ol>';\n\n const unorderedListResult1 = formatStringToHtml('- Item 1\\n- Item 2\\n- Item 3');\n expect(unorderedListResult1.html).toEqual(expectedUnorderedListResult);\n expect(unorderedListResult1.tables).toEqual([]);\n\n const unorderedListResult2 = formatStringToHtml('* Item 1\\n* Item 2\\n* Item 3');\n expect(unorderedListResult2.html).toEqual(expectedUnorderedListResult);\n expect(unorderedListResult2.tables).toEqual([]);\n\n const orderedListResult = formatStringToHtml('1. Item 1\\n2. Item 2\\n3. Item 3');\n expect(orderedListResult.html).toEqual(expectedOrderedListResult);\n expect(orderedListResult.tables).toEqual([]);\n\n const orderedListResult2 = formatStringToHtml('1) Item 1\\n2) Item 2\\n3) Item 3');\n expect(orderedListResult2.html).toEqual(expectedOrderedListResult);\n expect(orderedListResult2.tables).toEqual([]);\n });\n\n test('should format thematic breaks correctly', () => {\n const expectedThematicBreakResult = '<hr>';\n\n const result1 = formatStringToHtml('---');\n expect(result1.html).toEqual(expectedThematicBreakResult);\n expect(result1.tables).toEqual([]);\n\n const result2 = formatStringToHtml('***');\n expect(result2.html).toEqual(expectedThematicBreakResult);\n expect(result2.tables).toEqual([]);\n });\n\n test('should format code blocks correctly', () => {\n const resultWithoutLanguage = formatStringToHtml('```\\nconst a = 1;\\n```');\n expect(resultWithoutLanguage.html).toEqual('<pre><code>const a = 1;</code></pre>');\n expect(resultWithoutLanguage.tables).toEqual([]);\n\n const resultWithLanguage = formatStringToHtml('```js\\nconst a = 1;\\n```');\n expect(resultWithLanguage.html).toEqual(\n '<pre><code class=\"language-js\">const a = 1;</code></pre>',\n );\n expect(resultWithLanguage.tables).toEqual([]);\n });\n\n test('should format tables correctly', () => {\n const inputString =\n '| Header 1 | Header 2 |\\n|----------|----------|\\n| Cell 1 | Cell 2 |';\n const result = formatStringToHtml(inputString);\n expect(removeLinebreaks(result.html)).toEqual(\n '<table id=\"formatted-table-0\"><thead><tr><th>Header 1</th><th>Header 2</th></tr></thead><tbody><tr><td>Cell 1</td><td>Cell 2</td></tr></tbody></table>',\n );\n expect(result.tables).toEqual([\n {\n csv: 'Header 1,Header 2\\nCell 1,Cell 2\\n',\n raw: inputString,\n id: 'formatted-table-0',\n },\n ]);\n });\n });\n\n describe('Inline Code', () => {\n describe('HTML In Code', () => {\n test('should escape < and > within inline code correctly', () => {\n const result1 = formatStringToHtml('`<div>Test</div>`');\n expect(result1.html).toEqual('<p><code>&lt;div&gt;Test&lt;/div&gt;</code></p>');\n expect(result1.tables).toEqual([]);\n });\n\n test('should not escape & within inline code', () => {\n const resultEscape1 = formatStringToHtml('`&lt;div&gt;Test&lt;/div&gt;`');\n expect(resultEscape1.html).toEqual(\n '<p><code>&lt;div&gt;Test&lt;/div&gt;</code></p>',\n );\n expect(resultEscape1.tables).toEqual([]);\n\n const resultEscape2 = formatStringToHtml(\n '`&amp;lt;div&amp;gt;Test&amp;lt;/div&amp;gt;`',\n );\n expect(resultEscape2.html).toEqual(\n '<p><code>&amp;lt;div&amp;gt;Test&amp;lt;/div&amp;gt;</code></p>',\n );\n expect(resultEscape2.tables).toEqual([]);\n });\n });\n\n test('should not format markdown within inline code', () => {\n const result = formatStringToHtml('`**bold** *italic*`');\n expect(result.html).toEqual('<p><code>**bold** *italic*</code></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should not format bb-code within inline code', () => {\n const result = formatStringToHtml('`[b]bold[/b]`', { parseBBCode: true });\n expect(result.html).toEqual('<p><code>[b]bold[/b]</code></p>');\n expect(result.tables).toEqual([]);\n });\n });\n\n describe('Codeblock', () => {\n test('should format code blocks with multiple lines correctly', () => {\n const resultWithoutLanguage = formatStringToHtml(\n '```\\nconst a = 1;\\nconst b = 2;\\n```',\n );\n expect(resultWithoutLanguage.html).toEqual(\n '<pre><code>const a = 1;\\nconst b = 2;</code></pre>',\n );\n expect(resultWithoutLanguage.tables).toEqual([]);\n\n const resultWithLanguage = formatStringToHtml(\n '```js\\nconst a = 1;\\nconst b = 2;\\n```',\n );\n expect(resultWithLanguage.html).toEqual(\n '<pre><code class=\"language-js\">const a = 1;\\nconst b = 2;</code></pre>',\n );\n expect(resultWithLanguage.tables).toEqual([]);\n });\n\n test('should not format 4 spaces as code block', () => {\n const result = formatStringToHtml(' const a = 1;');\n expect(result.html).toEqual('<p> const a = 1;</p>');\n expect(result.tables).toEqual([]);\n });\n\n describe('HTML In Code', () => {\n test('should escape < and > within code block', () => {\n const resultWithoutLanguage = formatStringToHtml('```\\n<div>Test</div>\\n```');\n expect(resultWithoutLanguage.html).toEqual(\n '<pre><code>&lt;div&gt;Test&lt;/div&gt;</code></pre>',\n );\n expect(resultWithoutLanguage.tables).toEqual([]);\n\n const resultWithLanguage = formatStringToHtml('```html\\n<div>Test</div>\\n```');\n expect(resultWithLanguage.html).toEqual(\n '<pre><code class=\"language-html\">&lt;div&gt;Test&lt;/div&gt;</code></pre>',\n );\n expect(resultWithLanguage.tables).toEqual([]);\n });\n\n test('should not escape & within code block', () => {\n const resultEscape1 = formatStringToHtml(\n '```\\n&lt;div&gt;Test&lt;/div&gt;\\n```',\n );\n expect(resultEscape1.html).toEqual(\n '<pre><code>&lt;div&gt;Test&lt;/div&gt;</code></pre>',\n );\n expect(resultEscape1.tables).toEqual([]);\n\n const resultEscape2 = formatStringToHtml(\n '```\\n&amp;lt;div&amp;gt;Test&amp;lt;/div&amp;gt;\\n```',\n );\n expect(resultEscape2.html).toEqual(\n '<pre><code>&amp;lt;div&amp;gt;Test&amp;lt;/div&amp;gt;</code></pre>',\n );\n expect(resultEscape2.tables).toEqual([]);\n });\n });\n\n test('should not format markdown within code block', () => {\n const resultWithoutLanguage = formatStringToHtml('```\\n**Test**\\n```');\n expect(resultWithoutLanguage.html).toEqual('<pre><code>**Test**</code></pre>');\n expect(resultWithoutLanguage.tables).toEqual([]);\n\n const resultWithLanguage = formatStringToHtml('```html\\n**Test**\\n```');\n expect(resultWithLanguage.html).toEqual(\n '<pre><code class=\"language-html\">**Test**</code></pre>',\n );\n expect(resultWithLanguage.tables).toEqual([]);\n });\n\n test('should not format bb-code within code block', () => {\n const resultWithoutLanguage = formatStringToHtml('```\\n[b]Test[/b]\\n```');\n expect(resultWithoutLanguage.html).toEqual('<pre><code>[b]Test[/b]</code></pre>');\n expect(resultWithoutLanguage.tables).toEqual([]);\n\n const resultWithLanguage = formatStringToHtml('```html\\n[b]Test[/b]\\n```');\n expect(resultWithLanguage.html).toEqual(\n '<pre><code class=\"language-html\">[b]Test[/b]</code></pre>',\n );\n expect(resultWithLanguage.tables).toEqual([]);\n });\n });\n\n describe('Table', () => {\n test('should format markdown within table correctly', () => {\n const inputString =\n '| Header 1 | Header 2 |\\n|----------|----------|\\n| **Cell 1** | *Cell 2* |';\n const result = formatStringToHtml(inputString);\n expect(removeLinebreaks(result.html)).toEqual(\n '<table id=\"formatted-table-0\"><thead><tr><th>Header 1</th><th>Header 2</th></tr></thead><tbody><tr><td><strong>Cell 1</strong></td><td><em>Cell 2</em></td></tr></tbody></table>',\n );\n expect(result.tables).toEqual([\n {\n csv: 'Header 1,Header 2\\n**Cell 1**,*Cell 2*\\n',\n raw: inputString,\n id: 'formatted-table-0',\n },\n ]);\n });\n\n test('should format bb-code within table correctly', () => {\n const inputString =\n '| Header 1 | Header 2 |\\n|----------|----------|\\n| [b]Cell 1[/b] | [i]Cell 2[/i] |';\n const result = formatStringToHtml(inputString, {\n parseBBCode: true,\n });\n expect(removeLinebreaks(result.html)).toEqual(\n '<table id=\"formatted-table-0\"><thead><tr><th>Header 1</th><th>Header 2</th></tr></thead><tbody><tr><td><b>Cell 1</b></td><td><i>Cell 2</i></td></tr></tbody></table>',\n );\n expect(result.tables).toEqual([\n {\n csv: 'Header 1,Header 2\\n[b]Cell 1[/b],[i]Cell 2[/i]\\n',\n raw: inputString,\n id: 'formatted-table-0',\n },\n ]);\n });\n\n test('should format html within table correctly', () => {\n const inputString =\n '| Header 1 | Header 2 | Header 3 |\\n|----------|----------|----------|\\n| <div>Cell 1</div> | &lt;div&gt;Cell 2&lt;/div&gt; | &amp;lt;div&amp;gt;Cell 3&amp;lt;/div&amp;gt; |';\n const result = formatStringToHtml(inputString, {\n parseBBCode: true,\n });\n expect(removeLinebreaks(result.html)).toEqual(\n '<table id=\"formatted-table-0\"><thead><tr><th>Header 1</th><th>Header 2</th><th>Header 3</th></tr></thead><tbody><tr><td>&lt;div&gt;Cell 1&lt;/div&gt;</td><td>&lt;div&gt;Cell 2&lt;/div&gt;</td><td>&amp;lt;div&amp;gt;Cell 3&amp;lt;/div&amp;gt;</td></tr></tbody></table>',\n );\n expect(result.tables).toEqual([\n {\n csv: 'Header 1,Header 2,Header 3\\n<div>Cell 1</div>,<div>Cell 2</div>,&lt;div&gt;Cell 3&lt;/div&gt;\\n',\n raw: '| Header 1 | Header 2 | Header 3 |\\n|----------|----------|----------|\\n| <div>Cell 1</div> | <div>Cell 2</div> | &lt;div&gt;Cell 3&lt;/div&gt; |',\n id: 'formatted-table-0',\n },\n ]);\n });\n\n test('should format multiple tables correctly', () => {\n const table1 =\n '| Header 1 | Header 2 |\\n|----------|----------|\\n| Cell 1 | Cell 2 |';\n const getTable1Result = (index: number) =>\n `<table id=\"formatted-table-${index}\"><thead><tr><th>Header 1</th><th>Header 2</th></tr></thead><tbody><tr><td>Cell 1</td><td>Cell 2</td></tr></tbody></table>`;\n const table1Csv = 'Header 1,Header 2\\nCell 1,Cell 2\\n';\n const table2 =\n '| Header 3 | Header 4 |\\n|----------|----------|\\n| Cell 3 | Cell 4 |';\n const getTable2TResult = (index: number) =>\n `<table id=\"formatted-table-${index}\"><thead><tr><th>Header 3</th><th>Header 4</th></tr></thead><tbody><tr><td>Cell 3</td><td>Cell 4</td></tr></tbody></table>`;\n const table2Csv = 'Header 3,Header 4\\nCell 3,Cell 4\\n';\n\n const result1 = formatStringToHtml(`${table1}\\n\\n${table2}`);\n expect(removeLinebreaks(result1.html)).toEqual(\n `${getTable1Result(0)}${getTable2TResult(1)}`,\n );\n expect(result1.tables).toEqual([\n {\n csv: table1Csv,\n raw: `${table1}\\n\\n`,\n id: 'formatted-table-0',\n },\n {\n csv: table2Csv,\n raw: table2,\n id: 'formatted-table-1',\n },\n ]);\n\n // Tables in reverse order.\n const result2 = formatStringToHtml(`${table2}\\n\\n${table1}`);\n expect(removeLinebreaks(result2.html)).toEqual(\n `${getTable2TResult(0)}${getTable1Result(1)}`,\n );\n expect(result2.tables).toEqual([\n {\n csv: table2Csv,\n raw: `${table2}\\n\\n`,\n id: 'formatted-table-0',\n },\n {\n csv: table1Csv,\n raw: table1,\n id: 'formatted-table-1',\n },\n ]);\n });\n });\n\n describe('List', () => {\n test('should format markdown within list correctly', () => {\n const result = formatStringToHtml('- **Item 1**\\n- *Item 2*');\n expect(removeLinebreaks(result.html)).toEqual(\n '<ul><li><strong>Item 1</strong></li><li><em>Item 2</em></li></ul>',\n );\n expect(result.tables).toEqual([]);\n });\n\n test('should format task lists correctly', () => {\n const result1 = formatStringToHtml('- [ ] 1\\n- [x] 2\\n- [X] 3');\n expect(removeLinebreaks(result1.html)).toEqual(\n '<ul><li>[ ] 1</li><li>[x] 2</li><li>[x] 3</li></ul>',\n );\n expect(result1.tables).toEqual([]);\n });\n });\n\n describe('Combined Elements', () => {\n test('should format code block within list correctly', () => {\n const result = formatStringToHtml('* test\\n ```\\n test\\n ```');\n expect(removeLinebreaks(result.html)).toEqual(\n '<ul><li>test<pre><code>test</code></pre></li></ul>',\n );\n expect(result.tables).toEqual([]);\n });\n });\n\n describe('Conflicts with BB-Code', () => {\n test('should not format bb code tag followed by paranthese to link', () => {\n const result = formatStringToHtml('[b]bold[/b](test)', { parseBBCode: true });\n expect(result.html).toEqual('<p><b>bold</b>(test)</p>');\n expect(result.tables).toEqual([]);\n });\n });\n });\n\n describe('Format BB-Code', () => {\n describe('All Elements', () => {\n describe('Inline Elements', () => {\n // b, strong, i, em, u, s, span, img\n test('should format b tag correctly', () => {\n const result = formatStringToHtml('[b]bold[/b]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><b>bold</b></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format strong tag correctly', () => {\n const result = formatStringToHtml('[strong]bold[/strong]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><strong>bold</strong></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format i tag correctly', () => {\n const result = formatStringToHtml('[i]italic[/i]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><i>italic</i></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format em tag correctly', () => {\n const result = formatStringToHtml('[em]italic[/em]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><em>italic</em></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format u tag correctly', () => {\n const result = formatStringToHtml('[u]underline[/u]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><u>underline</u></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format s tag correctly', () => {\n const result = formatStringToHtml('[s]strike[/s]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><s>strike</s></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format span tag correctly', () => {\n const result = formatStringToHtml('[span]span[/span]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><span>span</span></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format img tag correctly', () => {\n const result = formatStringToHtml(\n '[img src=\"https://example.com/image.jpg\"][/img]',\n {\n parseBBCode: true,\n },\n );\n expect(result.html).toEqual('<p><img src=\"https://example.com/image.jpg\"></p>');\n expect(result.tables).toEqual([]);\n });\n });\n\n describe('Block Level Elements', () => {\n test('should format center tag correctly', () => {\n const result = formatStringToHtml('[center]centered text[/center]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><center>centered text</center></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format ul tag correctly', () => {\n const result = formatStringToHtml('[ul][li]Item 1[/li][li]Item 2[/li][/ul]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><ul><li>Item 1</li><li>Item 2</li></ul></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format ol tag correctly', () => {\n const result = formatStringToHtml('[ol][li]Item 1[/li][li]Item 2[/li][/ol]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><ol><li>Item 1</li><li>Item 2</li></ol></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format li tag correctly', () => {\n const result = formatStringToHtml('[li]Item[/li]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><li>Item</li></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format heading tags correctly', () => {\n const getHeadingInput = (tag: string) => `[${tag}]${tag}[/${tag}]`;\n const getHeadingOutput = (tag: string) => `<p><${tag}>${tag}</${tag}></p>`;\n const headingTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];\n\n headingTags.forEach((tag) => {\n const result = formatStringToHtml(getHeadingInput(tag), {\n parseBBCode: true,\n });\n expect(result.html).toEqual(getHeadingOutput(tag));\n expect(result.tables).toEqual([]);\n });\n });\n\n test('should format p tag correctly', () => {\n const result = formatStringToHtml('[p]paragraph[/p]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><p>paragraph</p></p>');\n expect(result.tables).toEqual([]);\n });\n });\n\n describe('Custom Elements', () => {\n test('should format custom tags correctly', () => {\n const input = '[custom attribute1=\"test1\" attribute2=\"test2\"]custom[/custom]';\n const output =\n '<p><bb-code-custom attribute1=\"test1\" attribute2=\"test2\">custom</bb-code-custom></p>';\n const result1 = formatStringToHtml(input, {\n parseBBCode: true,\n customInlineLevelBBCodeTags: ['custom'],\n });\n expect(result1.html).toEqual(output);\n expect(result1.tables).toEqual([]);\n\n const result2 = formatStringToHtml(input, {\n parseBBCode: true,\n customBlockLevelBBCodeTags: ['custom'],\n });\n expect(result2.html).toEqual(output);\n expect(result2.tables).toEqual([]);\n });\n\n test('should not format unknown custom tags', () => {\n const result = formatStringToHtml('[unknown]unknown[/unknown]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p>[unknown]unknown[/unknown]</p>');\n expect(result.tables).toEqual([]);\n });\n });\n\n describe('Line breaks', () => {\n describe('Between Elements', () => {\n test('should format line breaks between block level elements correctly', () => {\n const result1 = formatStringToHtml('[h1]h1[/h1]\\n[h2]h2[/h2]', {\n parseBBCode: true,\n });\n expect(result1.html).toEqual('<p><h1>h1</h1><h2>h2</h2></p>');\n expect(result1.tables).toEqual([]);\n\n const result2 = formatStringToHtml('[h1]h1[/h1]\\n\\n[h2]h2[/h2]', {\n parseBBCode: true,\n });\n expect(result2.html).toEqual('<p><h1>h1</h1></p>\\n<p><h2>h2</h2></p>');\n expect(result2.tables).toEqual([]);\n });\n\n test('should format line breaks between inline elements correctly', () => {\n const result1 = formatStringToHtml('[b]bold[/b]\\n[i]italic[/i]', {\n parseBBCode: true,\n });\n expect(result1.html).toEqual('<p><b>bold</b>\\n<i>italic</i></p>');\n expect(result1.tables).toEqual([]);\n\n const result2 = formatStringToHtml('[b]bold[/b]\\n\\n[i]italic[/i]', {\n parseBBCode: true,\n });\n expect(result2.html).toEqual('<p><b>bold</b></p>\\n<p><i>italic</i></p>');\n expect(result2.tables).toEqual([]);\n });\n });\n\n describe('Within Elements', () => {\n test('should format line breaks within block level elements correctly', () => {\n const result = formatStringToHtml('[h1]Line 1\\nLine 2[/h1]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><h1>Line 1\\nLine 2</h1></p>');\n expect(result.tables).toEqual([]);\n });\n\n // This is a test that would fail!\n // test('should format multiple line breaks within block level elements correctly', () => {\n // const result = formatStringToHtml('[h1]Line 1\\n\\nLine 2[/h1]', {\n // parseBBCode: true,\n // });\n // expect(result.html).toEqual('<p><h1>Line 1\\nLine 2</h1></p>');\n // expect(result.tables).toEqual([]);\n // });\n\n test('should remove trailing and leading new lines within block level elements', () => {\n const result = formatStringToHtml('[h1]\\n\\n\\nLine 1\\n\\n\\n[/h1]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><h1>Line 1</h1></p>');\n expect(result.tables).toEqual([]);\n });\n });\n });\n\n test('should not format url in tag attributes', () => {\n const result = formatStringToHtml(\n '[link url=\"https://www.google.com\"]Google[/link]',\n {\n parseBBCode: true,\n customInlineLevelBBCodeTags: ['link'],\n },\n );\n expect(result.html).toEqual(\n '<p><bb-code-link url=\"https://www.google.com\">Google</bb-code-link></p>',\n );\n expect(result.tables).toEqual([]);\n });\n\n test('should apply style attribute correctly', () => {\n const result = formatStringToHtml('[span style=\"color: red;\"]red text[/span]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><span style=\"color: red;\">red text</span></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format nested elements correctly', () => {\n const result = formatStringToHtml('[b][i]bold italic[/i][/b]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><b><i>bold italic</i></b></p>');\n expect(result.tables).toEqual([]);\n });\n });\n });\n\n describe('Combined Formatting (Markdown + BB-Code)', () => {\n test('should format bb-code within markdown correctly', () => {\n const result = formatStringToHtml('*[b]bold[/b]*', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><em><b>bold</b></em></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format markdown within bb-code correctly', () => {\n const result = formatStringToHtml('[b]*bold*[/b]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><b><em>bold</em></b></p>');\n expect(result.tables).toEqual([]);\n });\n });\n});\n"],"mappings":";;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAEA,MAAME,gBAAgB,GAAIC,IAAY,IAAKA,IAAI,CAACC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;AAElE,IAAAC,gBAAQ,EAAC,yBAAyB,EAAE,MAAM;EACtC,IAAAA,gBAAQ,EAAC,mBAAmB,EAAE,MAAM;IAChC,IAAAA,gBAAQ,EAAC,aAAa,EAAE,MAAM;MAC1B,IAAAC,YAAI,EAAC,qCAAqC,EAAE,MAAM;QAC9C,MAAMC,MAAM,GAAG,IAAAC,gCAAkB,EAAC,gBAAgB,CAAC;QACnD,IAAAC,cAAM,EAACF,MAAM,CAACG,IAAI,CAAC,CAACC,OAAO,CAAC,uBAAuB,CAAC;QACpD,IAAAF,cAAM,EAACF,MAAM,CAACK,MAAM,CAAC,C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10 +69,7 @@ export const parseBBCode = (text, options) => {
69
69
  }
70
70
  const isCustomTag = [...customBlockLevelTags, ...customInlineLevelTags].includes(Tag);
71
71
  const htmlTag = isCustomTag ? `${BB_CODE_HTML_TAG_PREFIX}${Tag}` : Tag;
72
- const openingHtmlTag = `<${htmlTag}${Object.entries(parameters).length > 0 ? ' ' : ''}${Object.entries(parameters).map(_ref => {
73
- let [key, value] = _ref;
74
- return `${key}="${value}"`;
75
- }).join(' ')}>`;
72
+ const openingHtmlTag = `<${htmlTag}${Object.entries(parameters).length > 0 ? ' ' : ''}${Object.entries(parameters).map(([key, value]) => `${key}="${value}"`).join(' ')}>`;
76
73
  const closingHtmlTag = `</${htmlTag}>`;
77
74
  const element = Tag === 'img' ? openingHtmlTag : openingHtmlTag + parsedContent + closingHtmlTag;
78
75
  html = `${html.slice(0, indexOfFullMatch)}${element}${htmlAfterTag}`;
@@ -1 +1 @@
1
- {"version":3,"file":"formatBBCode.js","names":["BB_CODE_HTML_TAG_PREFIX","findFirstBBCode","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 { BB_CODE_HTML_TAG_PREFIX } from '../../../constants/format';\nimport { findFirstBBCode } from './findBBCode';\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}\n\ninterface ParseBBCodePrivateOptions extends ParseBBCodesOptions {\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?: ParseBBCodePrivateOptions) => {\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;', '[').replaceA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[]}
1
+ {"version":3,"file":"formatBBCode.js","names":["BB_CODE_HTML_TAG_PREFIX","findFirstBBCode","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","key","value","join","closingHtmlTag","element","replaceAll","unescapeBBCodeSquareBrackets"],"sources":["../../../../../src/utils/formatString/bb-code/formatBBCode.ts"],"sourcesContent":["import { BB_CODE_HTML_TAG_PREFIX } from '../../../constants/format';\nimport { findFirstBBCode } from './findBBCode';\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}\n\ninterface ParseBBCodePrivateOptions extends ParseBBCodesOptions {\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?: ParseBBCodePrivateOptions) => {\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,uBAAuB,QAAQ,2BAA2B;AACnE,SAASC,eAAe,QAAQ,cAAc;AAE9C,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;AAW7E;AACA;AACA;AACA,OAAO,MAAMC,WAAW,GAAGA,CAACC,IAAY,EAAEC,OAAmC,KAAK;EAC9E,MAAM;IACFC,0BAA0B,EAAEC,oBAAoB,GAAG,EAAE;IACrDC,2BAA2B,EAAEC,qBAAqB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O,GAAG;MAEtC,MAAMS,OAAO,GACTxB,GAAG,KAAK,KAAK,GAAGgB,cAAc,GAAGA,cAAc,GAAGV,aAAa,GAAGiB,cAAc;MAEpFnC,IAAI,GAAG,GAAGA,IAAI,CAACI,KAAK,CAAC,CAAC,EAAEe,gBAAgB,CAAC,GAAGiB,OAAO,GAAGX,YAAY,EAAE;;MAEpE;MACAxB,gBAAgB,GAAGkB,gBAAgB,GAAGiB,OAAO,CAAClC,MAAM;IACxD;EACJ;EAEA,OAAOF,IAAI;AACf,CAAC;AAED,OAAO,MAAMsB,0BAA0B,GAAI7B,IAAY,IACnDA,IAAI,CAAC4C,UAAU,CAAC,GAAG,EAAE,aAAa,CAAC,CAACA,UAAU,CAAC,GAAG,EAAE,aAAa,CAAC;AAEtE,OAAO,MAAMC,4BAA4B,GAAI7C,IAAY,IACrDA,IAAI,CAAC4C,UAAU,CAAC,aAAa,EAAE,GAAG,CAAC,CAACA,UAAU,CAAC,aAAa,EAAE,GAAG,CAAC","ignoreList":[]}
@@ -102,7 +102,7 @@ describe('HTML Formatter Function', () => {
102
102
  });
103
103
  test('should format lists correctly', () => {
104
104
  const expectedUnorderedListResult = '<ul>\n<li>Item 1</li>\n<li>Item 2</li>\n<li>Item 3</li>\n</ul>';
105
- const expectedOrderedListResult = '<ol>\n<li>Item 1</li>\n<li>Item 2</li>\n<li>Item 3</li>\n</ol>';
105
+ const expectedOrderedListResult = '<ol>\n<li value="1">Item 1</li>\n<li value="2">Item 2</li>\n<li value="3">Item 3</li>\n</ol>';
106
106
  const unorderedListResult1 = formatStringToHtml('- Item 1\n- Item 2\n- Item 3');
107
107
  expect(unorderedListResult1.html).toEqual(expectedUnorderedListResult);
108
108
  expect(unorderedListResult1.tables).toEqual([]);
@@ -1 +1 @@
1
- {"version":3,"file":"formatString.test.js","names":["describe","expect","test","formatStringToHtml","removeLinebreaks","text","replace","result","html","toEqual","tables","resultEscape","resultEscape1","resultEscape2","boldResult","italicResult","inlineCodeResult","h1Result","h2Result","h3Result","h4Result","h5Result","h6Result","expectedUnorderedListResult","expectedOrderedListResult","unorderedListResult1","unorderedListResult2","orderedListResult","orderedListResult2","expectedThematicBreakResult","result1","result2","resultWithoutLanguage","resultWithLanguage","inputString","csv","raw","id","parseBBCode","table1","getTable1Result","index","table1Csv","table2","getTable2TResult","table2Csv","getHeadingInput","tag","getHeadingOutput","headingTags","forEach","input","output","customInlineLevelBBCodeTags","customBlockLevelBBCodeTags"],"sources":["../../../../src/utils/formatString/formatString.test.ts"],"sourcesContent":["import { describe, expect, test } from 'vitest';\nimport { formatStringToHtml } from './formatString';\n\nconst removeLinebreaks = (text: string) => text.replace(/\\n/g, '');\n\ndescribe('HTML Formatter Function', () => {\n describe('Format Plain Text', () => {\n describe('Line breaks', () => {\n test('should format line breaks correctly', () => {\n const result = formatStringToHtml('Line 1\\nLine 2');\n expect(result.html).toEqual('<p>Line 1\\nLine 2</p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format multiple line breaks correctly', () => {\n const result = formatStringToHtml('Line 1\\n\\nLine 2');\n expect(result.html).toEqual('<p>Line 1</p>\\n<p>Line 2</p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should remove trailing and leading new lines', () => {\n const result = formatStringToHtml('\\n\\n\\nLine 1\\n\\n\\n');\n expect(result.html).toEqual('<p>Line 1</p>');\n expect(result.tables).toEqual([]);\n });\n });\n\n describe('Whitespaces', () => {\n test('should not remove repeated whitespaces', () => {\n const result = formatStringToHtml('Text with spaces');\n expect(result.html).toEqual('<p>Text with spaces</p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should not remove leading and trailing whitespaces', () => {\n const result = formatStringToHtml(' Text ');\n expect(result.html).toEqual('<p> Text </p>');\n expect(result.tables).toEqual([]);\n });\n });\n\n describe('HTML', () => {\n test('should escape < and > correctly', () => {\n const resultEscape = formatStringToHtml('<div>Test</div>');\n expect(resultEscape.html).toEqual('<p>&lt;div&gt;Test&lt;/div&gt;</p>');\n expect(resultEscape.tables).toEqual([]);\n });\n\n test('should not escape &', () => {\n const resultEscape1 = formatStringToHtml('&lt;div&gt;Test&lt;/div&gt;');\n expect(resultEscape1.html).toEqual('<p>&lt;div&gt;Test&lt;/div&gt;</p>');\n expect(resultEscape1.tables).toEqual([]);\n\n const resultEscape2 = formatStringToHtml(\n '&amp;lt;div&amp;gt;Test&amp;lt;/div&amp;gt;',\n );\n expect(resultEscape2.html).toEqual(\n '<p>&amp;lt;div&amp;gt;Test&amp;lt;/div&amp;gt;</p>',\n );\n expect(resultEscape2.tables).toEqual([]);\n });\n\n // TODO Decide if & should be escaped, when they are not part of an HTML entity.\n });\n\n describe('URLs', () => {\n test('should not format URLs', () => {\n const result = formatStringToHtml('https://example.com');\n expect(result.html).toEqual('<p>https://example.com</p>');\n expect(result.tables).toEqual([]);\n });\n });\n });\n\n describe('Format Markdown', () => {\n describe('All Elements', () => {\n test('should format text styling correctly', () => {\n const boldResult = formatStringToHtml('**bold**');\n expect(boldResult.html).toEqual('<p><strong>bold</strong></p>');\n expect(boldResult.tables).toEqual([]);\n\n const italicResult = formatStringToHtml('*italic*');\n expect(italicResult.html).toEqual('<p><em>italic</em></p>');\n expect(italicResult.tables).toEqual([]);\n\n const inlineCodeResult = formatStringToHtml('`inline code`');\n expect(inlineCodeResult.html).toEqual('<p><code>inline code</code></p>');\n expect(inlineCodeResult.tables).toEqual([]);\n });\n\n test('should format headings correctly', () => {\n const h1Result = formatStringToHtml('# h1');\n expect(h1Result.html).toEqual('<h1>h1</h1>');\n expect(h1Result.tables).toEqual([]);\n\n const h2Result = formatStringToHtml('## h2');\n expect(h2Result.html).toEqual('<h2>h2</h2>');\n expect(h2Result.tables).toEqual([]);\n\n const h3Result = formatStringToHtml('### h3');\n expect(h3Result.html).toEqual('<h3>h3</h3>');\n expect(h3Result.tables).toEqual([]);\n\n const h4Result = formatStringToHtml('#### h4');\n expect(h4Result.html).toEqual('<h4>h4</h4>');\n expect(h4Result.tables).toEqual([]);\n\n const h5Result = formatStringToHtml('##### h5');\n expect(h5Result.html).toEqual('<h5>h5</h5>');\n expect(h5Result.tables).toEqual([]);\n\n const h6Result = formatStringToHtml('###### h6');\n expect(h6Result.html).toEqual('<h6>h6</h6>');\n expect(h6Result.tables).toEqual([]);\n });\n\n test('should format links correctly', () => {\n const result = formatStringToHtml('[Link](https://example.com)');\n expect(result.html).toEqual('<p><a href=\"https://example.com\">Link</a></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format images correctly', () => {\n const result = formatStringToHtml('![Alt Text](https://example.com/image.jpg)');\n expect(result.html).toEqual(\n '<p><img src=\"https://example.com/image.jpg\" alt=\"Alt Text\"></p>',\n );\n expect(result.tables).toEqual([]);\n });\n\n test('should format lists correctly', () => {\n const expectedUnorderedListResult =\n '<ul>\\n<li>Item 1</li>\\n<li>Item 2</li>\\n<li>Item 3</li>\\n</ul>';\n const expectedOrderedListResult =\n '<ol>\\n<li>Item 1</li>\\n<li>Item 2</li>\\n<li>Item 3</li>\\n</ol>';\n\n const unorderedListResult1 = formatStringToHtml('- Item 1\\n- Item 2\\n- Item 3');\n expect(unorderedListResult1.html).toEqual(expectedUnorderedListResult);\n expect(unorderedListResult1.tables).toEqual([]);\n\n const unorderedListResult2 = formatStringToHtml('* Item 1\\n* Item 2\\n* Item 3');\n expect(unorderedListResult2.html).toEqual(expectedUnorderedListResult);\n expect(unorderedListResult2.tables).toEqual([]);\n\n const orderedListResult = formatStringToHtml('1. Item 1\\n2. Item 2\\n3. Item 3');\n expect(orderedListResult.html).toEqual(expectedOrderedListResult);\n expect(orderedListResult.tables).toEqual([]);\n\n const orderedListResult2 = formatStringToHtml('1) Item 1\\n2) Item 2\\n3) Item 3');\n expect(orderedListResult2.html).toEqual(expectedOrderedListResult);\n expect(orderedListResult2.tables).toEqual([]);\n });\n\n test('should format thematic breaks correctly', () => {\n const expectedThematicBreakResult = '<hr>';\n\n const result1 = formatStringToHtml('---');\n expect(result1.html).toEqual(expectedThematicBreakResult);\n expect(result1.tables).toEqual([]);\n\n const result2 = formatStringToHtml('***');\n expect(result2.html).toEqual(expectedThematicBreakResult);\n expect(result2.tables).toEqual([]);\n });\n\n test('should format code blocks correctly', () => {\n const resultWithoutLanguage = formatStringToHtml('```\\nconst a = 1;\\n```');\n expect(resultWithoutLanguage.html).toEqual('<pre><code>const a = 1;</code></pre>');\n expect(resultWithoutLanguage.tables).toEqual([]);\n\n const resultWithLanguage = formatStringToHtml('```js\\nconst a = 1;\\n```');\n expect(resultWithLanguage.html).toEqual(\n '<pre><code class=\"language-js\">const a = 1;</code></pre>',\n );\n expect(resultWithLanguage.tables).toEqual([]);\n });\n\n test('should format tables correctly', () => {\n const inputString =\n '| Header 1 | Header 2 |\\n|----------|----------|\\n| Cell 1 | Cell 2 |';\n const result = formatStringToHtml(inputString);\n expect(removeLinebreaks(result.html)).toEqual(\n '<table id=\"formatted-table-0\"><thead><tr><th>Header 1</th><th>Header 2</th></tr></thead><tbody><tr><td>Cell 1</td><td>Cell 2</td></tr></tbody></table>',\n );\n expect(result.tables).toEqual([\n {\n csv: 'Header 1,Header 2\\nCell 1,Cell 2\\n',\n raw: inputString,\n id: 'formatted-table-0',\n },\n ]);\n });\n });\n\n describe('Inline Code', () => {\n describe('HTML In Code', () => {\n test('should escape < and > within inline code correctly', () => {\n const result1 = formatStringToHtml('`<div>Test</div>`');\n expect(result1.html).toEqual('<p><code>&lt;div&gt;Test&lt;/div&gt;</code></p>');\n expect(result1.tables).toEqual([]);\n });\n\n test('should not escape & within inline code', () => {\n const resultEscape1 = formatStringToHtml('`&lt;div&gt;Test&lt;/div&gt;`');\n expect(resultEscape1.html).toEqual(\n '<p><code>&lt;div&gt;Test&lt;/div&gt;</code></p>',\n );\n expect(resultEscape1.tables).toEqual([]);\n\n const resultEscape2 = formatStringToHtml(\n '`&amp;lt;div&amp;gt;Test&amp;lt;/div&amp;gt;`',\n );\n expect(resultEscape2.html).toEqual(\n '<p><code>&amp;lt;div&amp;gt;Test&amp;lt;/div&amp;gt;</code></p>',\n );\n expect(resultEscape2.tables).toEqual([]);\n });\n });\n\n test('should not format markdown within inline code', () => {\n const result = formatStringToHtml('`**bold** *italic*`');\n expect(result.html).toEqual('<p><code>**bold** *italic*</code></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should not format bb-code within inline code', () => {\n const result = formatStringToHtml('`[b]bold[/b]`', { parseBBCode: true });\n expect(result.html).toEqual('<p><code>[b]bold[/b]</code></p>');\n expect(result.tables).toEqual([]);\n });\n });\n\n describe('Codeblock', () => {\n test('should format code blocks with multiple lines correctly', () => {\n const resultWithoutLanguage = formatStringToHtml(\n '```\\nconst a = 1;\\nconst b = 2;\\n```',\n );\n expect(resultWithoutLanguage.html).toEqual(\n '<pre><code>const a = 1;\\nconst b = 2;</code></pre>',\n );\n expect(resultWithoutLanguage.tables).toEqual([]);\n\n const resultWithLanguage = formatStringToHtml(\n '```js\\nconst a = 1;\\nconst b = 2;\\n```',\n );\n expect(resultWithLanguage.html).toEqual(\n '<pre><code class=\"language-js\">const a = 1;\\nconst b = 2;</code></pre>',\n );\n expect(resultWithLanguage.tables).toEqual([]);\n });\n\n test('should not format 4 spaces as code block', () => {\n const result = formatStringToHtml(' const a = 1;');\n expect(result.html).toEqual('<p> const a = 1;</p>');\n expect(result.tables).toEqual([]);\n });\n\n describe('HTML In Code', () => {\n test('should escape < and > within code block', () => {\n const resultWithoutLanguage = formatStringToHtml('```\\n<div>Test</div>\\n```');\n expect(resultWithoutLanguage.html).toEqual(\n '<pre><code>&lt;div&gt;Test&lt;/div&gt;</code></pre>',\n );\n expect(resultWithoutLanguage.tables).toEqual([]);\n\n const resultWithLanguage = formatStringToHtml('```html\\n<div>Test</div>\\n```');\n expect(resultWithLanguage.html).toEqual(\n '<pre><code class=\"language-html\">&lt;div&gt;Test&lt;/div&gt;</code></pre>',\n );\n expect(resultWithLanguage.tables).toEqual([]);\n });\n\n test('should not escape & within code block', () => {\n const resultEscape1 = formatStringToHtml(\n '```\\n&lt;div&gt;Test&lt;/div&gt;\\n```',\n );\n expect(resultEscape1.html).toEqual(\n '<pre><code>&lt;div&gt;Test&lt;/div&gt;</code></pre>',\n );\n expect(resultEscape1.tables).toEqual([]);\n\n const resultEscape2 = formatStringToHtml(\n '```\\n&amp;lt;div&amp;gt;Test&amp;lt;/div&amp;gt;\\n```',\n );\n expect(resultEscape2.html).toEqual(\n '<pre><code>&amp;lt;div&amp;gt;Test&amp;lt;/div&amp;gt;</code></pre>',\n );\n expect(resultEscape2.tables).toEqual([]);\n });\n });\n\n test('should not format markdown within code block', () => {\n const resultWithoutLanguage = formatStringToHtml('```\\n**Test**\\n```');\n expect(resultWithoutLanguage.html).toEqual('<pre><code>**Test**</code></pre>');\n expect(resultWithoutLanguage.tables).toEqual([]);\n\n const resultWithLanguage = formatStringToHtml('```html\\n**Test**\\n```');\n expect(resultWithLanguage.html).toEqual(\n '<pre><code class=\"language-html\">**Test**</code></pre>',\n );\n expect(resultWithLanguage.tables).toEqual([]);\n });\n\n test('should not format bb-code within code block', () => {\n const resultWithoutLanguage = formatStringToHtml('```\\n[b]Test[/b]\\n```');\n expect(resultWithoutLanguage.html).toEqual('<pre><code>[b]Test[/b]</code></pre>');\n expect(resultWithoutLanguage.tables).toEqual([]);\n\n const resultWithLanguage = formatStringToHtml('```html\\n[b]Test[/b]\\n```');\n expect(resultWithLanguage.html).toEqual(\n '<pre><code class=\"language-html\">[b]Test[/b]</code></pre>',\n );\n expect(resultWithLanguage.tables).toEqual([]);\n });\n });\n\n describe('Table', () => {\n test('should format markdown within table correctly', () => {\n const inputString =\n '| Header 1 | Header 2 |\\n|----------|----------|\\n| **Cell 1** | *Cell 2* |';\n const result = formatStringToHtml(inputString);\n expect(removeLinebreaks(result.html)).toEqual(\n '<table id=\"formatted-table-0\"><thead><tr><th>Header 1</th><th>Header 2</th></tr></thead><tbody><tr><td><strong>Cell 1</strong></td><td><em>Cell 2</em></td></tr></tbody></table>',\n );\n expect(result.tables).toEqual([\n {\n csv: 'Header 1,Header 2\\n**Cell 1**,*Cell 2*\\n',\n raw: inputString,\n id: 'formatted-table-0',\n },\n ]);\n });\n\n test('should format bb-code within table correctly', () => {\n const inputString =\n '| Header 1 | Header 2 |\\n|----------|----------|\\n| [b]Cell 1[/b] | [i]Cell 2[/i] |';\n const result = formatStringToHtml(inputString, {\n parseBBCode: true,\n });\n expect(removeLinebreaks(result.html)).toEqual(\n '<table id=\"formatted-table-0\"><thead><tr><th>Header 1</th><th>Header 2</th></tr></thead><tbody><tr><td><b>Cell 1</b></td><td><i>Cell 2</i></td></tr></tbody></table>',\n );\n expect(result.tables).toEqual([\n {\n csv: 'Header 1,Header 2\\n[b]Cell 1[/b],[i]Cell 2[/i]\\n',\n raw: inputString,\n id: 'formatted-table-0',\n },\n ]);\n });\n\n test('should format html within table correctly', () => {\n const inputString =\n '| Header 1 | Header 2 | Header 3 |\\n|----------|----------|----------|\\n| <div>Cell 1</div> | &lt;div&gt;Cell 2&lt;/div&gt; | &amp;lt;div&amp;gt;Cell 3&amp;lt;/div&amp;gt; |';\n const result = formatStringToHtml(inputString, {\n parseBBCode: true,\n });\n expect(removeLinebreaks(result.html)).toEqual(\n '<table id=\"formatted-table-0\"><thead><tr><th>Header 1</th><th>Header 2</th><th>Header 3</th></tr></thead><tbody><tr><td>&lt;div&gt;Cell 1&lt;/div&gt;</td><td>&lt;div&gt;Cell 2&lt;/div&gt;</td><td>&amp;lt;div&amp;gt;Cell 3&amp;lt;/div&amp;gt;</td></tr></tbody></table>',\n );\n expect(result.tables).toEqual([\n {\n csv: 'Header 1,Header 2,Header 3\\n<div>Cell 1</div>,<div>Cell 2</div>,&lt;div&gt;Cell 3&lt;/div&gt;\\n',\n raw: '| Header 1 | Header 2 | Header 3 |\\n|----------|----------|----------|\\n| <div>Cell 1</div> | <div>Cell 2</div> | &lt;div&gt;Cell 3&lt;/div&gt; |',\n id: 'formatted-table-0',\n },\n ]);\n });\n\n test('should format multiple tables correctly', () => {\n const table1 =\n '| Header 1 | Header 2 |\\n|----------|----------|\\n| Cell 1 | Cell 2 |';\n const getTable1Result = (index: number) =>\n `<table id=\"formatted-table-${index}\"><thead><tr><th>Header 1</th><th>Header 2</th></tr></thead><tbody><tr><td>Cell 1</td><td>Cell 2</td></tr></tbody></table>`;\n const table1Csv = 'Header 1,Header 2\\nCell 1,Cell 2\\n';\n const table2 =\n '| Header 3 | Header 4 |\\n|----------|----------|\\n| Cell 3 | Cell 4 |';\n const getTable2TResult = (index: number) =>\n `<table id=\"formatted-table-${index}\"><thead><tr><th>Header 3</th><th>Header 4</th></tr></thead><tbody><tr><td>Cell 3</td><td>Cell 4</td></tr></tbody></table>`;\n const table2Csv = 'Header 3,Header 4\\nCell 3,Cell 4\\n';\n\n const result1 = formatStringToHtml(`${table1}\\n\\n${table2}`);\n expect(removeLinebreaks(result1.html)).toEqual(\n `${getTable1Result(0)}${getTable2TResult(1)}`,\n );\n expect(result1.tables).toEqual([\n {\n csv: table1Csv,\n raw: `${table1}\\n\\n`,\n id: 'formatted-table-0',\n },\n {\n csv: table2Csv,\n raw: table2,\n id: 'formatted-table-1',\n },\n ]);\n\n // Tables in reverse order.\n const result2 = formatStringToHtml(`${table2}\\n\\n${table1}`);\n expect(removeLinebreaks(result2.html)).toEqual(\n `${getTable2TResult(0)}${getTable1Result(1)}`,\n );\n expect(result2.tables).toEqual([\n {\n csv: table2Csv,\n raw: `${table2}\\n\\n`,\n id: 'formatted-table-0',\n },\n {\n csv: table1Csv,\n raw: table1,\n id: 'formatted-table-1',\n },\n ]);\n });\n });\n\n describe('List', () => {\n test('should format markdown within list correctly', () => {\n const result = formatStringToHtml('- **Item 1**\\n- *Item 2*');\n expect(removeLinebreaks(result.html)).toEqual(\n '<ul><li><strong>Item 1</strong></li><li><em>Item 2</em></li></ul>',\n );\n expect(result.tables).toEqual([]);\n });\n\n test('should format task lists correctly', () => {\n const result1 = formatStringToHtml('- [ ] 1\\n- [x] 2\\n- [X] 3');\n expect(removeLinebreaks(result1.html)).toEqual(\n '<ul><li>[ ] 1</li><li>[x] 2</li><li>[x] 3</li></ul>',\n );\n expect(result1.tables).toEqual([]);\n });\n });\n\n describe('Combined Elements', () => {\n test('should format code block within list correctly', () => {\n const result = formatStringToHtml('* test\\n ```\\n test\\n ```');\n expect(removeLinebreaks(result.html)).toEqual(\n '<ul><li>test<pre><code>test</code></pre></li></ul>',\n );\n expect(result.tables).toEqual([]);\n });\n });\n\n describe('Conflicts with BB-Code', () => {\n test('should not format bb code tag followed by paranthese to link', () => {\n const result = formatStringToHtml('[b]bold[/b](test)', { parseBBCode: true });\n expect(result.html).toEqual('<p><b>bold</b>(test)</p>');\n expect(result.tables).toEqual([]);\n });\n });\n });\n\n describe('Format BB-Code', () => {\n describe('All Elements', () => {\n describe('Inline Elements', () => {\n // b, strong, i, em, u, s, span, img\n test('should format b tag correctly', () => {\n const result = formatStringToHtml('[b]bold[/b]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><b>bold</b></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format strong tag correctly', () => {\n const result = formatStringToHtml('[strong]bold[/strong]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><strong>bold</strong></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format i tag correctly', () => {\n const result = formatStringToHtml('[i]italic[/i]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><i>italic</i></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format em tag correctly', () => {\n const result = formatStringToHtml('[em]italic[/em]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><em>italic</em></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format u tag correctly', () => {\n const result = formatStringToHtml('[u]underline[/u]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><u>underline</u></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format s tag correctly', () => {\n const result = formatStringToHtml('[s]strike[/s]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><s>strike</s></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format span tag correctly', () => {\n const result = formatStringToHtml('[span]span[/span]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><span>span</span></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format img tag correctly', () => {\n const result = formatStringToHtml(\n '[img src=\"https://example.com/image.jpg\"][/img]',\n {\n parseBBCode: true,\n },\n );\n expect(result.html).toEqual('<p><img src=\"https://example.com/image.jpg\"></p>');\n expect(result.tables).toEqual([]);\n });\n });\n\n describe('Block Level Elements', () => {\n test('should format center tag correctly', () => {\n const result = formatStringToHtml('[center]centered text[/center]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><center>centered text</center></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format ul tag correctly', () => {\n const result = formatStringToHtml('[ul][li]Item 1[/li][li]Item 2[/li][/ul]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><ul><li>Item 1</li><li>Item 2</li></ul></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format ol tag correctly', () => {\n const result = formatStringToHtml('[ol][li]Item 1[/li][li]Item 2[/li][/ol]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><ol><li>Item 1</li><li>Item 2</li></ol></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format li tag correctly', () => {\n const result = formatStringToHtml('[li]Item[/li]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><li>Item</li></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format heading tags correctly', () => {\n const getHeadingInput = (tag: string) => `[${tag}]${tag}[/${tag}]`;\n const getHeadingOutput = (tag: string) => `<p><${tag}>${tag}</${tag}></p>`;\n const headingTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];\n\n headingTags.forEach((tag) => {\n const result = formatStringToHtml(getHeadingInput(tag), {\n parseBBCode: true,\n });\n expect(result.html).toEqual(getHeadingOutput(tag));\n expect(result.tables).toEqual([]);\n });\n });\n\n test('should format p tag correctly', () => {\n const result = formatStringToHtml('[p]paragraph[/p]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><p>paragraph</p></p>');\n expect(result.tables).toEqual([]);\n });\n });\n\n describe('Custom Elements', () => {\n test('should format custom tags correctly', () => {\n const input = '[custom attribute1=\"test1\" attribute2=\"test2\"]custom[/custom]';\n const output =\n '<p><bb-code-custom attribute1=\"test1\" attribute2=\"test2\">custom</bb-code-custom></p>';\n const result1 = formatStringToHtml(input, {\n parseBBCode: true,\n customInlineLevelBBCodeTags: ['custom'],\n });\n expect(result1.html).toEqual(output);\n expect(result1.tables).toEqual([]);\n\n const result2 = formatStringToHtml(input, {\n parseBBCode: true,\n customBlockLevelBBCodeTags: ['custom'],\n });\n expect(result2.html).toEqual(output);\n expect(result2.tables).toEqual([]);\n });\n\n test('should not format unknown custom tags', () => {\n const result = formatStringToHtml('[unknown]unknown[/unknown]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p>[unknown]unknown[/unknown]</p>');\n expect(result.tables).toEqual([]);\n });\n });\n\n describe('Line breaks', () => {\n describe('Between Elements', () => {\n test('should format line breaks between block level elements correctly', () => {\n const result1 = formatStringToHtml('[h1]h1[/h1]\\n[h2]h2[/h2]', {\n parseBBCode: true,\n });\n expect(result1.html).toEqual('<p><h1>h1</h1><h2>h2</h2></p>');\n expect(result1.tables).toEqual([]);\n\n const result2 = formatStringToHtml('[h1]h1[/h1]\\n\\n[h2]h2[/h2]', {\n parseBBCode: true,\n });\n expect(result2.html).toEqual('<p><h1>h1</h1></p>\\n<p><h2>h2</h2></p>');\n expect(result2.tables).toEqual([]);\n });\n\n test('should format line breaks between inline elements correctly', () => {\n const result1 = formatStringToHtml('[b]bold[/b]\\n[i]italic[/i]', {\n parseBBCode: true,\n });\n expect(result1.html).toEqual('<p><b>bold</b>\\n<i>italic</i></p>');\n expect(result1.tables).toEqual([]);\n\n const result2 = formatStringToHtml('[b]bold[/b]\\n\\n[i]italic[/i]', {\n parseBBCode: true,\n });\n expect(result2.html).toEqual('<p><b>bold</b></p>\\n<p><i>italic</i></p>');\n expect(result2.tables).toEqual([]);\n });\n });\n\n describe('Within Elements', () => {\n test('should format line breaks within block level elements correctly', () => {\n const result = formatStringToHtml('[h1]Line 1\\nLine 2[/h1]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><h1>Line 1\\nLine 2</h1></p>');\n expect(result.tables).toEqual([]);\n });\n\n // This is a test that would fail!\n // test('should format multiple line breaks within block level elements correctly', () => {\n // const result = formatStringToHtml('[h1]Line 1\\n\\nLine 2[/h1]', {\n // parseBBCode: true,\n // });\n // expect(result.html).toEqual('<p><h1>Line 1\\nLine 2</h1></p>');\n // expect(result.tables).toEqual([]);\n // });\n\n test('should remove trailing and leading new lines within block level elements', () => {\n const result = formatStringToHtml('[h1]\\n\\n\\nLine 1\\n\\n\\n[/h1]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><h1>Line 1</h1></p>');\n expect(result.tables).toEqual([]);\n });\n });\n });\n\n test('should not format url in tag attributes', () => {\n const result = formatStringToHtml(\n '[link url=\"https://www.google.com\"]Google[/link]',\n {\n parseBBCode: true,\n customInlineLevelBBCodeTags: ['link'],\n },\n );\n expect(result.html).toEqual(\n '<p><bb-code-link url=\"https://www.google.com\">Google</bb-code-link></p>',\n );\n expect(result.tables).toEqual([]);\n });\n\n test('should apply style attribute correctly', () => {\n const result = formatStringToHtml('[span style=\"color: red;\"]red text[/span]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><span style=\"color: red;\">red text</span></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format nested elements correctly', () => {\n const result = formatStringToHtml('[b][i]bold italic[/i][/b]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><b><i>bold italic</i></b></p>');\n expect(result.tables).toEqual([]);\n });\n });\n });\n\n describe('Combined Formatting (Markdown + BB-Code)', () => {\n test('should format bb-code within markdown correctly', () => {\n const result = formatStringToHtml('*[b]bold[/b]*', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><em><b>bold</b></em></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format markdown within bb-code correctly', () => {\n const result = formatStringToHtml('[b]*bold*[/b]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><b><em>bold</em></b></p>');\n expect(result.tables).toEqual([]);\n });\n });\n});\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,IAAI,QAAQ,QAAQ;AAC/C,SAASC,kBAAkB,QAAQ,gBAAgB;AAEnD,MAAMC,gBAAgB,GAAIC,IAAY,IAAKA,IAAI,CAACC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;AAElEN,QAAQ,CAAC,yBAAyB,EAAE,MAAM;EACtCA,QAAQ,CAAC,mBAAmB,EAAE,MAAM;IAChCA,QAAQ,CAAC,aAAa,EAAE,MAAM;MAC1BE,IAAI,CAAC,qCAAqC,EAAE,MAAM;QAC9C,MAAMK,MAAM,GAAGJ,kBAAkB,CAAC,gBAAgB,CAAC;QACnDF,MAAM,CAACM,MAAM,CAACC,IAAI,CAAC,CAACC,OAAO,CAAC,uBAAuB,CAAC;QACpDR,MAAM,CAACM,MAAM,CAACG,MAAM,CAAC,CAACD,OAAO,CAAC,EAAE,CAAC;MACrC,CAAC,CAAC;MAEFP,IAAI,CAAC,8CAA8C,EAAE,MAAM;QACvD,MAAMK,MAAM,GAAGJ,kBAAkB,CAAC,kBAAkB,CAAC;QACrDF,MAAM,CAACM,MAAM,CAACC,IAAI,CAAC,CAACC,OAAO,CAAC,8BAA8B,CAAC;QAC3DR,MAAM,CAACM,MAAM,CAACG,MAAM,CAAC,CAACD,OAAO,CAAC,EAAE,CAAC;MACrC,CAAC,CAAC;MAEFP,IAAI,CAAC,8CAA8C,EAAE,MAAM;QACvD,MAAMK,MAAM,GAAGJ,kBAAkB,CAAC,oBAAoB,CAAC;QACvDF,MAAM,CAACM,MAAM,CAACC,IAAI,CAAC,CAACC,OAAO,CAAC,eAAe,CAAC;QAC5CR,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,EAAE,CAAC;IACrC,CAAC,CAAC;EACN,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"formatString.test.js","names":["describe","expect","test","formatStringToHtml","removeLinebreaks","text","replace","result","html","toEqual","tables","resultEscape","resultEscape1","resultEscape2","boldResult","italicResult","inlineCodeResult","h1Result","h2Result","h3Result","h4Result","h5Result","h6Result","expectedUnorderedListResult","expectedOrderedListResult","unorderedListResult1","unorderedListResult2","orderedListResult","orderedListResult2","expectedThematicBreakResult","result1","result2","resultWithoutLanguage","resultWithLanguage","inputString","csv","raw","id","parseBBCode","table1","getTable1Result","index","table1Csv","table2","getTable2TResult","table2Csv","getHeadingInput","tag","getHeadingOutput","headingTags","forEach","input","output","customInlineLevelBBCodeTags","customBlockLevelBBCodeTags"],"sources":["../../../../src/utils/formatString/formatString.test.ts"],"sourcesContent":["import { describe, expect, test } from 'vitest';\nimport { formatStringToHtml } from './formatString';\n\nconst removeLinebreaks = (text: string) => text.replace(/\\n/g, '');\n\ndescribe('HTML Formatter Function', () => {\n describe('Format Plain Text', () => {\n describe('Line breaks', () => {\n test('should format line breaks correctly', () => {\n const result = formatStringToHtml('Line 1\\nLine 2');\n expect(result.html).toEqual('<p>Line 1\\nLine 2</p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format multiple line breaks correctly', () => {\n const result = formatStringToHtml('Line 1\\n\\nLine 2');\n expect(result.html).toEqual('<p>Line 1</p>\\n<p>Line 2</p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should remove trailing and leading new lines', () => {\n const result = formatStringToHtml('\\n\\n\\nLine 1\\n\\n\\n');\n expect(result.html).toEqual('<p>Line 1</p>');\n expect(result.tables).toEqual([]);\n });\n });\n\n describe('Whitespaces', () => {\n test('should not remove repeated whitespaces', () => {\n const result = formatStringToHtml('Text with spaces');\n expect(result.html).toEqual('<p>Text with spaces</p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should not remove leading and trailing whitespaces', () => {\n const result = formatStringToHtml(' Text ');\n expect(result.html).toEqual('<p> Text </p>');\n expect(result.tables).toEqual([]);\n });\n });\n\n describe('HTML', () => {\n test('should escape < and > correctly', () => {\n const resultEscape = formatStringToHtml('<div>Test</div>');\n expect(resultEscape.html).toEqual('<p>&lt;div&gt;Test&lt;/div&gt;</p>');\n expect(resultEscape.tables).toEqual([]);\n });\n\n test('should not escape &', () => {\n const resultEscape1 = formatStringToHtml('&lt;div&gt;Test&lt;/div&gt;');\n expect(resultEscape1.html).toEqual('<p>&lt;div&gt;Test&lt;/div&gt;</p>');\n expect(resultEscape1.tables).toEqual([]);\n\n const resultEscape2 = formatStringToHtml(\n '&amp;lt;div&amp;gt;Test&amp;lt;/div&amp;gt;',\n );\n expect(resultEscape2.html).toEqual(\n '<p>&amp;lt;div&amp;gt;Test&amp;lt;/div&amp;gt;</p>',\n );\n expect(resultEscape2.tables).toEqual([]);\n });\n\n // TODO Decide if & should be escaped, when they are not part of an HTML entity.\n });\n\n describe('URLs', () => {\n test('should not format URLs', () => {\n const result = formatStringToHtml('https://example.com');\n expect(result.html).toEqual('<p>https://example.com</p>');\n expect(result.tables).toEqual([]);\n });\n });\n });\n\n describe('Format Markdown', () => {\n describe('All Elements', () => {\n test('should format text styling correctly', () => {\n const boldResult = formatStringToHtml('**bold**');\n expect(boldResult.html).toEqual('<p><strong>bold</strong></p>');\n expect(boldResult.tables).toEqual([]);\n\n const italicResult = formatStringToHtml('*italic*');\n expect(italicResult.html).toEqual('<p><em>italic</em></p>');\n expect(italicResult.tables).toEqual([]);\n\n const inlineCodeResult = formatStringToHtml('`inline code`');\n expect(inlineCodeResult.html).toEqual('<p><code>inline code</code></p>');\n expect(inlineCodeResult.tables).toEqual([]);\n });\n\n test('should format headings correctly', () => {\n const h1Result = formatStringToHtml('# h1');\n expect(h1Result.html).toEqual('<h1>h1</h1>');\n expect(h1Result.tables).toEqual([]);\n\n const h2Result = formatStringToHtml('## h2');\n expect(h2Result.html).toEqual('<h2>h2</h2>');\n expect(h2Result.tables).toEqual([]);\n\n const h3Result = formatStringToHtml('### h3');\n expect(h3Result.html).toEqual('<h3>h3</h3>');\n expect(h3Result.tables).toEqual([]);\n\n const h4Result = formatStringToHtml('#### h4');\n expect(h4Result.html).toEqual('<h4>h4</h4>');\n expect(h4Result.tables).toEqual([]);\n\n const h5Result = formatStringToHtml('##### h5');\n expect(h5Result.html).toEqual('<h5>h5</h5>');\n expect(h5Result.tables).toEqual([]);\n\n const h6Result = formatStringToHtml('###### h6');\n expect(h6Result.html).toEqual('<h6>h6</h6>');\n expect(h6Result.tables).toEqual([]);\n });\n\n test('should format links correctly', () => {\n const result = formatStringToHtml('[Link](https://example.com)');\n expect(result.html).toEqual('<p><a href=\"https://example.com\">Link</a></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format images correctly', () => {\n const result = formatStringToHtml('![Alt Text](https://example.com/image.jpg)');\n expect(result.html).toEqual(\n '<p><img src=\"https://example.com/image.jpg\" alt=\"Alt Text\"></p>',\n );\n expect(result.tables).toEqual([]);\n });\n\n test('should format lists correctly', () => {\n const expectedUnorderedListResult =\n '<ul>\\n<li>Item 1</li>\\n<li>Item 2</li>\\n<li>Item 3</li>\\n</ul>';\n const expectedOrderedListResult =\n '<ol>\\n<li value=\"1\">Item 1</li>\\n<li value=\"2\">Item 2</li>\\n<li value=\"3\">Item 3</li>\\n</ol>';\n\n const unorderedListResult1 = formatStringToHtml('- Item 1\\n- Item 2\\n- Item 3');\n expect(unorderedListResult1.html).toEqual(expectedUnorderedListResult);\n expect(unorderedListResult1.tables).toEqual([]);\n\n const unorderedListResult2 = formatStringToHtml('* Item 1\\n* Item 2\\n* Item 3');\n expect(unorderedListResult2.html).toEqual(expectedUnorderedListResult);\n expect(unorderedListResult2.tables).toEqual([]);\n\n const orderedListResult = formatStringToHtml('1. Item 1\\n2. Item 2\\n3. Item 3');\n expect(orderedListResult.html).toEqual(expectedOrderedListResult);\n expect(orderedListResult.tables).toEqual([]);\n\n const orderedListResult2 = formatStringToHtml('1) Item 1\\n2) Item 2\\n3) Item 3');\n expect(orderedListResult2.html).toEqual(expectedOrderedListResult);\n expect(orderedListResult2.tables).toEqual([]);\n });\n\n test('should format thematic breaks correctly', () => {\n const expectedThematicBreakResult = '<hr>';\n\n const result1 = formatStringToHtml('---');\n expect(result1.html).toEqual(expectedThematicBreakResult);\n expect(result1.tables).toEqual([]);\n\n const result2 = formatStringToHtml('***');\n expect(result2.html).toEqual(expectedThematicBreakResult);\n expect(result2.tables).toEqual([]);\n });\n\n test('should format code blocks correctly', () => {\n const resultWithoutLanguage = formatStringToHtml('```\\nconst a = 1;\\n```');\n expect(resultWithoutLanguage.html).toEqual('<pre><code>const a = 1;</code></pre>');\n expect(resultWithoutLanguage.tables).toEqual([]);\n\n const resultWithLanguage = formatStringToHtml('```js\\nconst a = 1;\\n```');\n expect(resultWithLanguage.html).toEqual(\n '<pre><code class=\"language-js\">const a = 1;</code></pre>',\n );\n expect(resultWithLanguage.tables).toEqual([]);\n });\n\n test('should format tables correctly', () => {\n const inputString =\n '| Header 1 | Header 2 |\\n|----------|----------|\\n| Cell 1 | Cell 2 |';\n const result = formatStringToHtml(inputString);\n expect(removeLinebreaks(result.html)).toEqual(\n '<table id=\"formatted-table-0\"><thead><tr><th>Header 1</th><th>Header 2</th></tr></thead><tbody><tr><td>Cell 1</td><td>Cell 2</td></tr></tbody></table>',\n );\n expect(result.tables).toEqual([\n {\n csv: 'Header 1,Header 2\\nCell 1,Cell 2\\n',\n raw: inputString,\n id: 'formatted-table-0',\n },\n ]);\n });\n });\n\n describe('Inline Code', () => {\n describe('HTML In Code', () => {\n test('should escape < and > within inline code correctly', () => {\n const result1 = formatStringToHtml('`<div>Test</div>`');\n expect(result1.html).toEqual('<p><code>&lt;div&gt;Test&lt;/div&gt;</code></p>');\n expect(result1.tables).toEqual([]);\n });\n\n test('should not escape & within inline code', () => {\n const resultEscape1 = formatStringToHtml('`&lt;div&gt;Test&lt;/div&gt;`');\n expect(resultEscape1.html).toEqual(\n '<p><code>&lt;div&gt;Test&lt;/div&gt;</code></p>',\n );\n expect(resultEscape1.tables).toEqual([]);\n\n const resultEscape2 = formatStringToHtml(\n '`&amp;lt;div&amp;gt;Test&amp;lt;/div&amp;gt;`',\n );\n expect(resultEscape2.html).toEqual(\n '<p><code>&amp;lt;div&amp;gt;Test&amp;lt;/div&amp;gt;</code></p>',\n );\n expect(resultEscape2.tables).toEqual([]);\n });\n });\n\n test('should not format markdown within inline code', () => {\n const result = formatStringToHtml('`**bold** *italic*`');\n expect(result.html).toEqual('<p><code>**bold** *italic*</code></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should not format bb-code within inline code', () => {\n const result = formatStringToHtml('`[b]bold[/b]`', { parseBBCode: true });\n expect(result.html).toEqual('<p><code>[b]bold[/b]</code></p>');\n expect(result.tables).toEqual([]);\n });\n });\n\n describe('Codeblock', () => {\n test('should format code blocks with multiple lines correctly', () => {\n const resultWithoutLanguage = formatStringToHtml(\n '```\\nconst a = 1;\\nconst b = 2;\\n```',\n );\n expect(resultWithoutLanguage.html).toEqual(\n '<pre><code>const a = 1;\\nconst b = 2;</code></pre>',\n );\n expect(resultWithoutLanguage.tables).toEqual([]);\n\n const resultWithLanguage = formatStringToHtml(\n '```js\\nconst a = 1;\\nconst b = 2;\\n```',\n );\n expect(resultWithLanguage.html).toEqual(\n '<pre><code class=\"language-js\">const a = 1;\\nconst b = 2;</code></pre>',\n );\n expect(resultWithLanguage.tables).toEqual([]);\n });\n\n test('should not format 4 spaces as code block', () => {\n const result = formatStringToHtml(' const a = 1;');\n expect(result.html).toEqual('<p> const a = 1;</p>');\n expect(result.tables).toEqual([]);\n });\n\n describe('HTML In Code', () => {\n test('should escape < and > within code block', () => {\n const resultWithoutLanguage = formatStringToHtml('```\\n<div>Test</div>\\n```');\n expect(resultWithoutLanguage.html).toEqual(\n '<pre><code>&lt;div&gt;Test&lt;/div&gt;</code></pre>',\n );\n expect(resultWithoutLanguage.tables).toEqual([]);\n\n const resultWithLanguage = formatStringToHtml('```html\\n<div>Test</div>\\n```');\n expect(resultWithLanguage.html).toEqual(\n '<pre><code class=\"language-html\">&lt;div&gt;Test&lt;/div&gt;</code></pre>',\n );\n expect(resultWithLanguage.tables).toEqual([]);\n });\n\n test('should not escape & within code block', () => {\n const resultEscape1 = formatStringToHtml(\n '```\\n&lt;div&gt;Test&lt;/div&gt;\\n```',\n );\n expect(resultEscape1.html).toEqual(\n '<pre><code>&lt;div&gt;Test&lt;/div&gt;</code></pre>',\n );\n expect(resultEscape1.tables).toEqual([]);\n\n const resultEscape2 = formatStringToHtml(\n '```\\n&amp;lt;div&amp;gt;Test&amp;lt;/div&amp;gt;\\n```',\n );\n expect(resultEscape2.html).toEqual(\n '<pre><code>&amp;lt;div&amp;gt;Test&amp;lt;/div&amp;gt;</code></pre>',\n );\n expect(resultEscape2.tables).toEqual([]);\n });\n });\n\n test('should not format markdown within code block', () => {\n const resultWithoutLanguage = formatStringToHtml('```\\n**Test**\\n```');\n expect(resultWithoutLanguage.html).toEqual('<pre><code>**Test**</code></pre>');\n expect(resultWithoutLanguage.tables).toEqual([]);\n\n const resultWithLanguage = formatStringToHtml('```html\\n**Test**\\n```');\n expect(resultWithLanguage.html).toEqual(\n '<pre><code class=\"language-html\">**Test**</code></pre>',\n );\n expect(resultWithLanguage.tables).toEqual([]);\n });\n\n test('should not format bb-code within code block', () => {\n const resultWithoutLanguage = formatStringToHtml('```\\n[b]Test[/b]\\n```');\n expect(resultWithoutLanguage.html).toEqual('<pre><code>[b]Test[/b]</code></pre>');\n expect(resultWithoutLanguage.tables).toEqual([]);\n\n const resultWithLanguage = formatStringToHtml('```html\\n[b]Test[/b]\\n```');\n expect(resultWithLanguage.html).toEqual(\n '<pre><code class=\"language-html\">[b]Test[/b]</code></pre>',\n );\n expect(resultWithLanguage.tables).toEqual([]);\n });\n });\n\n describe('Table', () => {\n test('should format markdown within table correctly', () => {\n const inputString =\n '| Header 1 | Header 2 |\\n|----------|----------|\\n| **Cell 1** | *Cell 2* |';\n const result = formatStringToHtml(inputString);\n expect(removeLinebreaks(result.html)).toEqual(\n '<table id=\"formatted-table-0\"><thead><tr><th>Header 1</th><th>Header 2</th></tr></thead><tbody><tr><td><strong>Cell 1</strong></td><td><em>Cell 2</em></td></tr></tbody></table>',\n );\n expect(result.tables).toEqual([\n {\n csv: 'Header 1,Header 2\\n**Cell 1**,*Cell 2*\\n',\n raw: inputString,\n id: 'formatted-table-0',\n },\n ]);\n });\n\n test('should format bb-code within table correctly', () => {\n const inputString =\n '| Header 1 | Header 2 |\\n|----------|----------|\\n| [b]Cell 1[/b] | [i]Cell 2[/i] |';\n const result = formatStringToHtml(inputString, {\n parseBBCode: true,\n });\n expect(removeLinebreaks(result.html)).toEqual(\n '<table id=\"formatted-table-0\"><thead><tr><th>Header 1</th><th>Header 2</th></tr></thead><tbody><tr><td><b>Cell 1</b></td><td><i>Cell 2</i></td></tr></tbody></table>',\n );\n expect(result.tables).toEqual([\n {\n csv: 'Header 1,Header 2\\n[b]Cell 1[/b],[i]Cell 2[/i]\\n',\n raw: inputString,\n id: 'formatted-table-0',\n },\n ]);\n });\n\n test('should format html within table correctly', () => {\n const inputString =\n '| Header 1 | Header 2 | Header 3 |\\n|----------|----------|----------|\\n| <div>Cell 1</div> | &lt;div&gt;Cell 2&lt;/div&gt; | &amp;lt;div&amp;gt;Cell 3&amp;lt;/div&amp;gt; |';\n const result = formatStringToHtml(inputString, {\n parseBBCode: true,\n });\n expect(removeLinebreaks(result.html)).toEqual(\n '<table id=\"formatted-table-0\"><thead><tr><th>Header 1</th><th>Header 2</th><th>Header 3</th></tr></thead><tbody><tr><td>&lt;div&gt;Cell 1&lt;/div&gt;</td><td>&lt;div&gt;Cell 2&lt;/div&gt;</td><td>&amp;lt;div&amp;gt;Cell 3&amp;lt;/div&amp;gt;</td></tr></tbody></table>',\n );\n expect(result.tables).toEqual([\n {\n csv: 'Header 1,Header 2,Header 3\\n<div>Cell 1</div>,<div>Cell 2</div>,&lt;div&gt;Cell 3&lt;/div&gt;\\n',\n raw: '| Header 1 | Header 2 | Header 3 |\\n|----------|----------|----------|\\n| <div>Cell 1</div> | <div>Cell 2</div> | &lt;div&gt;Cell 3&lt;/div&gt; |',\n id: 'formatted-table-0',\n },\n ]);\n });\n\n test('should format multiple tables correctly', () => {\n const table1 =\n '| Header 1 | Header 2 |\\n|----------|----------|\\n| Cell 1 | Cell 2 |';\n const getTable1Result = (index: number) =>\n `<table id=\"formatted-table-${index}\"><thead><tr><th>Header 1</th><th>Header 2</th></tr></thead><tbody><tr><td>Cell 1</td><td>Cell 2</td></tr></tbody></table>`;\n const table1Csv = 'Header 1,Header 2\\nCell 1,Cell 2\\n';\n const table2 =\n '| Header 3 | Header 4 |\\n|----------|----------|\\n| Cell 3 | Cell 4 |';\n const getTable2TResult = (index: number) =>\n `<table id=\"formatted-table-${index}\"><thead><tr><th>Header 3</th><th>Header 4</th></tr></thead><tbody><tr><td>Cell 3</td><td>Cell 4</td></tr></tbody></table>`;\n const table2Csv = 'Header 3,Header 4\\nCell 3,Cell 4\\n';\n\n const result1 = formatStringToHtml(`${table1}\\n\\n${table2}`);\n expect(removeLinebreaks(result1.html)).toEqual(\n `${getTable1Result(0)}${getTable2TResult(1)}`,\n );\n expect(result1.tables).toEqual([\n {\n csv: table1Csv,\n raw: `${table1}\\n\\n`,\n id: 'formatted-table-0',\n },\n {\n csv: table2Csv,\n raw: table2,\n id: 'formatted-table-1',\n },\n ]);\n\n // Tables in reverse order.\n const result2 = formatStringToHtml(`${table2}\\n\\n${table1}`);\n expect(removeLinebreaks(result2.html)).toEqual(\n `${getTable2TResult(0)}${getTable1Result(1)}`,\n );\n expect(result2.tables).toEqual([\n {\n csv: table2Csv,\n raw: `${table2}\\n\\n`,\n id: 'formatted-table-0',\n },\n {\n csv: table1Csv,\n raw: table1,\n id: 'formatted-table-1',\n },\n ]);\n });\n });\n\n describe('List', () => {\n test('should format markdown within list correctly', () => {\n const result = formatStringToHtml('- **Item 1**\\n- *Item 2*');\n expect(removeLinebreaks(result.html)).toEqual(\n '<ul><li><strong>Item 1</strong></li><li><em>Item 2</em></li></ul>',\n );\n expect(result.tables).toEqual([]);\n });\n\n test('should format task lists correctly', () => {\n const result1 = formatStringToHtml('- [ ] 1\\n- [x] 2\\n- [X] 3');\n expect(removeLinebreaks(result1.html)).toEqual(\n '<ul><li>[ ] 1</li><li>[x] 2</li><li>[x] 3</li></ul>',\n );\n expect(result1.tables).toEqual([]);\n });\n });\n\n describe('Combined Elements', () => {\n test('should format code block within list correctly', () => {\n const result = formatStringToHtml('* test\\n ```\\n test\\n ```');\n expect(removeLinebreaks(result.html)).toEqual(\n '<ul><li>test<pre><code>test</code></pre></li></ul>',\n );\n expect(result.tables).toEqual([]);\n });\n });\n\n describe('Conflicts with BB-Code', () => {\n test('should not format bb code tag followed by paranthese to link', () => {\n const result = formatStringToHtml('[b]bold[/b](test)', { parseBBCode: true });\n expect(result.html).toEqual('<p><b>bold</b>(test)</p>');\n expect(result.tables).toEqual([]);\n });\n });\n });\n\n describe('Format BB-Code', () => {\n describe('All Elements', () => {\n describe('Inline Elements', () => {\n // b, strong, i, em, u, s, span, img\n test('should format b tag correctly', () => {\n const result = formatStringToHtml('[b]bold[/b]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><b>bold</b></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format strong tag correctly', () => {\n const result = formatStringToHtml('[strong]bold[/strong]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><strong>bold</strong></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format i tag correctly', () => {\n const result = formatStringToHtml('[i]italic[/i]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><i>italic</i></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format em tag correctly', () => {\n const result = formatStringToHtml('[em]italic[/em]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><em>italic</em></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format u tag correctly', () => {\n const result = formatStringToHtml('[u]underline[/u]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><u>underline</u></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format s tag correctly', () => {\n const result = formatStringToHtml('[s]strike[/s]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><s>strike</s></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format span tag correctly', () => {\n const result = formatStringToHtml('[span]span[/span]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><span>span</span></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format img tag correctly', () => {\n const result = formatStringToHtml(\n '[img src=\"https://example.com/image.jpg\"][/img]',\n {\n parseBBCode: true,\n },\n );\n expect(result.html).toEqual('<p><img src=\"https://example.com/image.jpg\"></p>');\n expect(result.tables).toEqual([]);\n });\n });\n\n describe('Block Level Elements', () => {\n test('should format center tag correctly', () => {\n const result = formatStringToHtml('[center]centered text[/center]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><center>centered text</center></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format ul tag correctly', () => {\n const result = formatStringToHtml('[ul][li]Item 1[/li][li]Item 2[/li][/ul]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><ul><li>Item 1</li><li>Item 2</li></ul></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format ol tag correctly', () => {\n const result = formatStringToHtml('[ol][li]Item 1[/li][li]Item 2[/li][/ol]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><ol><li>Item 1</li><li>Item 2</li></ol></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format li tag correctly', () => {\n const result = formatStringToHtml('[li]Item[/li]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><li>Item</li></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format heading tags correctly', () => {\n const getHeadingInput = (tag: string) => `[${tag}]${tag}[/${tag}]`;\n const getHeadingOutput = (tag: string) => `<p><${tag}>${tag}</${tag}></p>`;\n const headingTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];\n\n headingTags.forEach((tag) => {\n const result = formatStringToHtml(getHeadingInput(tag), {\n parseBBCode: true,\n });\n expect(result.html).toEqual(getHeadingOutput(tag));\n expect(result.tables).toEqual([]);\n });\n });\n\n test('should format p tag correctly', () => {\n const result = formatStringToHtml('[p]paragraph[/p]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><p>paragraph</p></p>');\n expect(result.tables).toEqual([]);\n });\n });\n\n describe('Custom Elements', () => {\n test('should format custom tags correctly', () => {\n const input = '[custom attribute1=\"test1\" attribute2=\"test2\"]custom[/custom]';\n const output =\n '<p><bb-code-custom attribute1=\"test1\" attribute2=\"test2\">custom</bb-code-custom></p>';\n const result1 = formatStringToHtml(input, {\n parseBBCode: true,\n customInlineLevelBBCodeTags: ['custom'],\n });\n expect(result1.html).toEqual(output);\n expect(result1.tables).toEqual([]);\n\n const result2 = formatStringToHtml(input, {\n parseBBCode: true,\n customBlockLevelBBCodeTags: ['custom'],\n });\n expect(result2.html).toEqual(output);\n expect(result2.tables).toEqual([]);\n });\n\n test('should not format unknown custom tags', () => {\n const result = formatStringToHtml('[unknown]unknown[/unknown]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p>[unknown]unknown[/unknown]</p>');\n expect(result.tables).toEqual([]);\n });\n });\n\n describe('Line breaks', () => {\n describe('Between Elements', () => {\n test('should format line breaks between block level elements correctly', () => {\n const result1 = formatStringToHtml('[h1]h1[/h1]\\n[h2]h2[/h2]', {\n parseBBCode: true,\n });\n expect(result1.html).toEqual('<p><h1>h1</h1><h2>h2</h2></p>');\n expect(result1.tables).toEqual([]);\n\n const result2 = formatStringToHtml('[h1]h1[/h1]\\n\\n[h2]h2[/h2]', {\n parseBBCode: true,\n });\n expect(result2.html).toEqual('<p><h1>h1</h1></p>\\n<p><h2>h2</h2></p>');\n expect(result2.tables).toEqual([]);\n });\n\n test('should format line breaks between inline elements correctly', () => {\n const result1 = formatStringToHtml('[b]bold[/b]\\n[i]italic[/i]', {\n parseBBCode: true,\n });\n expect(result1.html).toEqual('<p><b>bold</b>\\n<i>italic</i></p>');\n expect(result1.tables).toEqual([]);\n\n const result2 = formatStringToHtml('[b]bold[/b]\\n\\n[i]italic[/i]', {\n parseBBCode: true,\n });\n expect(result2.html).toEqual('<p><b>bold</b></p>\\n<p><i>italic</i></p>');\n expect(result2.tables).toEqual([]);\n });\n });\n\n describe('Within Elements', () => {\n test('should format line breaks within block level elements correctly', () => {\n const result = formatStringToHtml('[h1]Line 1\\nLine 2[/h1]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><h1>Line 1\\nLine 2</h1></p>');\n expect(result.tables).toEqual([]);\n });\n\n // This is a test that would fail!\n // test('should format multiple line breaks within block level elements correctly', () => {\n // const result = formatStringToHtml('[h1]Line 1\\n\\nLine 2[/h1]', {\n // parseBBCode: true,\n // });\n // expect(result.html).toEqual('<p><h1>Line 1\\nLine 2</h1></p>');\n // expect(result.tables).toEqual([]);\n // });\n\n test('should remove trailing and leading new lines within block level elements', () => {\n const result = formatStringToHtml('[h1]\\n\\n\\nLine 1\\n\\n\\n[/h1]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><h1>Line 1</h1></p>');\n expect(result.tables).toEqual([]);\n });\n });\n });\n\n test('should not format url in tag attributes', () => {\n const result = formatStringToHtml(\n '[link url=\"https://www.google.com\"]Google[/link]',\n {\n parseBBCode: true,\n customInlineLevelBBCodeTags: ['link'],\n },\n );\n expect(result.html).toEqual(\n '<p><bb-code-link url=\"https://www.google.com\">Google</bb-code-link></p>',\n );\n expect(result.tables).toEqual([]);\n });\n\n test('should apply style attribute correctly', () => {\n const result = formatStringToHtml('[span style=\"color: red;\"]red text[/span]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><span style=\"color: red;\">red text</span></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format nested elements correctly', () => {\n const result = formatStringToHtml('[b][i]bold italic[/i][/b]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><b><i>bold italic</i></b></p>');\n expect(result.tables).toEqual([]);\n });\n });\n });\n\n describe('Combined Formatting (Markdown + BB-Code)', () => {\n test('should format bb-code within markdown correctly', () => {\n const result = formatStringToHtml('*[b]bold[/b]*', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><em><b>bold</b></em></p>');\n expect(result.tables).toEqual([]);\n });\n\n test('should format markdown within bb-code correctly', () => {\n const result = formatStringToHtml('[b]*bold*[/b]', {\n parseBBCode: true,\n });\n expect(result.html).toEqual('<p><b><em>bold</em></b></p>');\n expect(result.tables).toEqual([]);\n });\n });\n});\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,IAAI,QAAQ,QAAQ;AAC/C,SAASC,kBAAkB,QAAQ,gBAAgB;AAEnD,MAAMC,gBAAgB,GAAIC,IAAY,IAAKA,IAAI,CAACC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;AAElEN,QAAQ,CAAC,yBAAyB,EAAE,MAAM;EACtCA,QAAQ,CAAC,mBAAmB,EAAE,MAAM;IAChCA,QAAQ,CAAC,aAAa,EAAE,MAAM;MAC1BE,IAAI,CAAC,qCAAqC,EAAE,MAAM;QAC9C,MAAMK,MAAM,GAAGJ,kBAAkB,CAAC,gBAAgB,CAAC;QACnDF,MAAM,CAACM,MAAM,CAACC,IAAI,CAAC,CAACC,OAAO,CAAC,uBAAuB,CAAC;QACpDR,MAAM,CAACM,MAAM,CAACG,MAAM,CAAC,CAACD,OAAO,CAAC,EAAE,CAAC;MACrC,CAAC,CAAC;MAEFP,IAAI,CAAC,8CAA8C,EAAE,MAAM;QACvD,MAAMK,MAAM,GAAGJ,kBAAkB,CAAC,kBAAkB,CAAC;QACrDF,MAAM,CAACM,MAAM,CAACC,IAAI,CAAC,CAACC,OAAO,CAAC,8BAA8B,CAAC;QAC3DR,MAAM,CAACM,MAAM,CAACG,MAA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;MAC1D,MAAMK,MAAM,GAAGJ,kBAAkB,CAAC,eAAe,EAAE;QAC/CmC,WAAW,EAAE;MACjB,CAAC,CAAC;MACFrC,MAAM,CAACM,MAAM,CAACC,IAAI,CAAC,CAACC,OAAO,CAAC,6BAA6B,CAAC;MAC1DR,MAAM,CAACM,MAAM,CAACG,MAAM,CAAC,CAACD,OAAO,CAAC,EAAE,CAAC;IACrC,CAAC,CAAC;EACN,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
@@ -93,10 +93,9 @@ const renderer = {
93
93
  // This is the easiest way to prevent the formatting of markdown checkboxes in lists.
94
94
  // This can modify the input string slightly, since the capitalization of the checkbox can be lost.
95
95
  // If a user types '- [X]' it will be replaced with '- [x]' => the capitalization is lost.
96
- checkbox(_ref) {
97
- let {
98
- checked
99
- } = _ref;
96
+ checkbox({
97
+ checked
98
+ }) {
100
99
  return checked ? '[x]' : '[ ]';
101
100
  },
102
101
  // Ensures that the numbering of ordered lists is preserved.
@@ -1 +1 @@
1
- {"version":3,"file":"formatMarkdown.js","names":["marked","stringify","escapeBBCodeSquareBrackets","inlineCodeRule","inlineTextRule","TABLE_ID_PREFIX","tokenizer","codespan","src","cap","exec","text","replace","hasNonSpaceChars","test","hasSpaceCharsOnBothEnds","substring","length","type","raw","undefined","lheading","url","code","inlineText","escape","br","list","renderer","lang","langString","match","checkbox","_ref","checked","listitem","item","task","trim","value","slice","itemBody","parser","parse","tokens","loose","postprocess","html","tableIndex","modifiedString","result","use","hooks","parseMarkdown","parseBBCode","walkTokens","token","unescapeHtml","replaceAll","getMarkdownTables","tableTokens","push","tables","forEach","tableToken","index","tableArray","header","rowArray","rows","row","cell","csv","id"],"sources":["../../../../../src/utils/formatString/markdown/formatMarkdown.ts"],"sourcesContent":["import { marked, Tokens } from 'marked';\nimport type { TableObject } from '../../../types/format';\n// eslint-disable-next-line import/extensions,import/no-unresolved\nimport { stringify } from 'csv-stringify/browser/esm/sync';\nimport { escapeBBCodeSquareBrackets } from '../bb-code/formatBBCode';\n\nconst inlineCodeRule = /^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/;\nconst inlineTextRule = /^(`+|[^`])(?:(?= {2,}\\n)|[\\s\\S]*?(?:(?=[\\\\<![`*_]|\\b_|$)|[^ ](?= {2,}\\n)))/;\n\nconst TABLE_ID_PREFIX = 'formatted-table-';\n\n/*\n The marked Pipeline, including tokenizer, renderer and hooks are explained here:\n https://marked.js.org/using_pro\n*/\n\nconst tokenizer = {\n // Codespan Tokenizer is overwritten to prevent html escaping, since html is already escaped.\n // The function is copied from marked.js and slightly modified: https://github.com/markedjs/marked/blob/42954aaba960b6f815b24ec0d39da464960e4ec9/src/Tokenizer.ts#L749\n codespan(src: string): Tokens.Codespan | undefined {\n const cap = inlineCodeRule.exec(src);\n if (cap) {\n let text = (cap[2] as string).replace(/\\n/g, ' ');\n const hasNonSpaceChars = /[^ ]/.test(text);\n const hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text);\n if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {\n text = text.substring(1, text.length - 1);\n }\n\n return {\n type: 'codespan',\n raw: cap[0],\n text,\n };\n }\n\n return undefined;\n },\n // Disables Markdown formatting for setext headings.\n lheading(): Tokens.Heading | undefined {\n return undefined;\n },\n // Disables converting urls to hyperlinks.\n url() {\n return undefined;\n },\n // Disables converting text with 4 leading spaces to code block.\n code() {\n return undefined;\n },\n // inlineText is overwritten to prevent html escaping, specifically since quote characters are escaped, which breaks the attributes of bb-code elements.\n // The function is copied from marked.js and slightly modified: https://github.com/markedjs/marked/blob/42954aaba960b6f815b24ec0d39da464960e4ec9/src/Tokenizer.ts#L854\n inlineText(src: string) {\n const cap = inlineTextRule.exec(src);\n if (cap) {\n return {\n type: 'text',\n raw: cap[0],\n text: cap[0],\n };\n }\n return undefined;\n },\n // Disables escaping of characters via backslash. This is needed for LaTeX formulas, since multiline LaTeX formulas have 2 backslashes at the end of their lines.\n // Without this function, the backslashes would be escaped and the LaTeX formula would be broken.\n escape() {\n return undefined;\n },\n // Disables the conversion of backslash at the end of a line to a line break. This is needed for LaTeX formulas, since multiline LaTeX formulas have 2 backslashes at the end of their lines.\n // Without this '\\\\' would be converted to '\\<br>' which breaks LaTeX formulas.\n br() {\n return undefined;\n },\n // Only recognizes ordered lists, that start with the number 1.\n // Also recognizes ordered lists, that contain a list item with the number 1, so those lists are\n list(src: string) {\n // The regex is copied from marked.js: https://github.com/markedjs/marked/blob/4fc639e053a605b25abf66dccaa70c1bf6562eb7/src/rules.ts#L115\n if (/^( {0,3}[*+-]|1[.)])/.test(src)) {\n return false;\n }\n\n // Prevents the text from being recognized as a list.\n return undefined;\n },\n};\n\nconst renderer = {\n // Code Renderer is overwritten to prevent html escaping, since html is already escaped.\n // The function is copied from marked.js and slightly modified: https://github.com/markedjs/marked/blob/42954aaba960b6f815b24ec0d39da464960e4ec9/src/Renderer.ts#L24\n code(text: string, lang: string): string {\n const langString = (lang || '').match(/^\\S*/)?.[0];\n\n const code = `${text.replace(/\\n$/, '')}`;\n\n if (!langString) {\n return `<pre><code>${code}</code></pre>\\n`;\n }\n\n return `<pre><code class=\"language-${langString}\">${code}</code></pre>\\n`;\n },\n // Replaces the checkbox input elements with markdown checkboxes.\n // This is the easiest way to prevent the formatting of markdown checkboxes in lists.\n // This can modify the input string slightly, since the capitalization of the checkbox can be lost.\n // If a user types '- [X]' it will be replaced with '- [x]' => the capitalization is lost.\n checkbox({ checked }: Tokens.Checkbox) {\n return checked ? '[x]' : '[ ]';\n },\n // Ensures that the numbering of ordered lists is preserved.\n listitem: function (item: Tokens.ListItem) {\n if (item.task) {\n return false;\n }\n\n const match = item.raw.trim().match(/^\\d{1,9}[.)]/);\n // Removes the trailing dot or parenthesis from the match.\n const value = match ? match[0].slice(0, match[0].length - 1) : '';\n if (value) {\n let itemBody = '';\n // @ts-ignore\n itemBody += this.parser.parse(item.tokens, !!item.loose);\n // Sets the value attribute of the list item to the number of the list item.\n return `<li value=\"${value}\">${itemBody}</li>\\n`;\n }\n\n // Ensures that the default listitem renderer from marked js is used.\n return false;\n },\n};\n\nconst postprocess = (html: string): string => {\n let tableIndex = 0;\n // Assigns ids to tables.\n const modifiedString = html.replace(/(<table>)/g, () => {\n const result = `<table id=\"${TABLE_ID_PREFIX}${tableIndex}\">`;\n tableIndex++;\n return result;\n });\n\n return modifiedString;\n};\n\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nmarked.use({ tokenizer, renderer, hooks: { postprocess } });\n\n// Parses markdown following the Github Flavored Markdown specification.\n// The tokenizer and renderer are slightly modified to prevent html escaping in code block and inline code.\nexport const parseMarkdown = (text: string, parseBBCode: boolean) =>\n marked.parse(text, {\n walkTokens: (token) => {\n if (parseBBCode && (token.type === 'codespan' || token.type === 'code')) {\n // eslint-disable-next-line no-param-reassign\n (token as Tokens.Codespan).text = escapeBBCodeSquareBrackets(\n (token as Tokens.Codespan).text,\n );\n }\n },\n }) as string;\n\n// It is important that, &amp; is replaced lastly to prevent double escaping.\nconst unescapeHtml = (text: string) =>\n text.replaceAll('&lt;', '<').replaceAll('&gt;', '>').replaceAll('&amp;', '&');\n\nexport const getMarkdownTables = (text: string): TableObject[] => {\n const tableTokens: Tokens.Table[] = [];\n\n marked.parse(text, {\n walkTokens: (token) => {\n if (token.type === 'table') {\n tableTokens.push(token as Tokens.Table);\n }\n },\n }) as string;\n\n const tables: TableObject[] = [];\n\n tableTokens.forEach((tableToken, index) => {\n const tableArray: string[][] = [];\n\n if (tableToken.header?.length > 0) {\n const rowArray: string[] = [];\n\n tableToken.header.forEach((header) => {\n rowArray.push(unescapeHtml(header.text));\n });\n\n tableArray.push(rowArray);\n }\n if (tableToken.rows?.length > 0) {\n tableToken.rows.forEach((row) => {\n const rowArray: string[] = [];\n\n row.forEach((cell) => {\n rowArray.push(unescapeHtml(cell.text));\n });\n\n tableArray.push(rowArray);\n });\n }\n\n const csv = stringify(tableArray || []);\n\n tables.push({\n raw: unescapeHtml(tableToken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ClBH,QAAQ,CAACP,IAAI,CAACJ,YAAY,CAACc,IAAI,CAAC5D,IAAI,CAAC,CAAC;QAC1C,CAAC,CAAC;QAEFuD,UAAU,CAACL,IAAI,CAACO,QAAQ,CAAC;MAC7B,CAAC,CAAC;IACN;IAEA,MAAMI,GAAG,GAAGvE,SAAS,CAACiE,UAAU,IAAI,EAAE,CAAC;IAEvCJ,MAAM,CAACD,IAAI,CAAC;MACR1C,GAAG,EAAEsC,YAAY,CAACO,UAAU,CAAC7C,GAAG,CAAC;MACjCqD,GAAG;MACHC,EAAE,EAAE,GAAGpE,eAAe,GAAG4D,KAAK;IAClC,CAAC,CAAC;EACN,CAAC,CAAC;EAEF,OAAOH,MAAM;AACjB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"formatMarkdown.js","names":["marked","stringify","escapeBBCodeSquareBrackets","inlineCodeRule","inlineTextRule","TABLE_ID_PREFIX","tokenizer","codespan","src","cap","exec","text","replace","hasNonSpaceChars","test","hasSpaceCharsOnBothEnds","substring","length","type","raw","undefined","lheading","url","code","inlineText","escape","br","list","renderer","lang","langString","match","checkbox","checked","listitem","item","task","trim","value","slice","itemBody","parser","parse","tokens","loose","postprocess","html","tableIndex","modifiedString","result","use","hooks","parseMarkdown","parseBBCode","walkTokens","token","unescapeHtml","replaceAll","getMarkdownTables","tableTokens","push","tables","forEach","tableToken","index","tableArray","header","rowArray","rows","row","cell","csv","id"],"sources":["../../../../../src/utils/formatString/markdown/formatMarkdown.ts"],"sourcesContent":["import { marked, Tokens } from 'marked';\nimport type { TableObject } from '../../../types/format';\n// eslint-disable-next-line import/extensions,import/no-unresolved\nimport { stringify } from 'csv-stringify/browser/esm/sync';\nimport { escapeBBCodeSquareBrackets } from '../bb-code/formatBBCode';\n\nconst inlineCodeRule = /^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/;\nconst inlineTextRule = /^(`+|[^`])(?:(?= {2,}\\n)|[\\s\\S]*?(?:(?=[\\\\<![`*_]|\\b_|$)|[^ ](?= {2,}\\n)))/;\n\nconst TABLE_ID_PREFIX = 'formatted-table-';\n\n/*\n The marked Pipeline, including tokenizer, renderer and hooks are explained here:\n https://marked.js.org/using_pro\n*/\n\nconst tokenizer = {\n // Codespan Tokenizer is overwritten to prevent html escaping, since html is already escaped.\n // The function is copied from marked.js and slightly modified: https://github.com/markedjs/marked/blob/42954aaba960b6f815b24ec0d39da464960e4ec9/src/Tokenizer.ts#L749\n codespan(src: string): Tokens.Codespan | undefined {\n const cap = inlineCodeRule.exec(src);\n if (cap) {\n let text = (cap[2] as string).replace(/\\n/g, ' ');\n const hasNonSpaceChars = /[^ ]/.test(text);\n const hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text);\n if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {\n text = text.substring(1, text.length - 1);\n }\n\n return {\n type: 'codespan',\n raw: cap[0],\n text,\n };\n }\n\n return undefined;\n },\n // Disables Markdown formatting for setext headings.\n lheading(): Tokens.Heading | undefined {\n return undefined;\n },\n // Disables converting urls to hyperlinks.\n url() {\n return undefined;\n },\n // Disables converting text with 4 leading spaces to code block.\n code() {\n return undefined;\n },\n // inlineText is overwritten to prevent html escaping, specifically since quote characters are escaped, which breaks the attributes of bb-code elements.\n // The function is copied from marked.js and slightly modified: https://github.com/markedjs/marked/blob/42954aaba960b6f815b24ec0d39da464960e4ec9/src/Tokenizer.ts#L854\n inlineText(src: string) {\n const cap = inlineTextRule.exec(src);\n if (cap) {\n return {\n type: 'text',\n raw: cap[0],\n text: cap[0],\n };\n }\n return undefined;\n },\n // Disables escaping of characters via backslash. This is needed for LaTeX formulas, since multiline LaTeX formulas have 2 backslashes at the end of their lines.\n // Without this function, the backslashes would be escaped and the LaTeX formula would be broken.\n escape() {\n return undefined;\n },\n // Disables the conversion of backslash at the end of a line to a line break. This is needed for LaTeX formulas, since multiline LaTeX formulas have 2 backslashes at the end of their lines.\n // Without this '\\\\' would be converted to '\\<br>' which breaks LaTeX formulas.\n br() {\n return undefined;\n },\n // Only recognizes ordered lists, that start with the number 1.\n // Also recognizes ordered lists, that contain a list item with the number 1, so those lists are\n list(src: string) {\n // The regex is copied from marked.js: https://github.com/markedjs/marked/blob/4fc639e053a605b25abf66dccaa70c1bf6562eb7/src/rules.ts#L115\n if (/^( {0,3}[*+-]|1[.)])/.test(src)) {\n return false;\n }\n\n // Prevents the text from being recognized as a list.\n return undefined;\n },\n};\n\nconst renderer = {\n // Code Renderer is overwritten to prevent html escaping, since html is already escaped.\n // The function is copied from marked.js and slightly modified: https://github.com/markedjs/marked/blob/42954aaba960b6f815b24ec0d39da464960e4ec9/src/Renderer.ts#L24\n code(text: string, lang: string): string {\n const langString = (lang || '').match(/^\\S*/)?.[0];\n\n const code = `${text.replace(/\\n$/, '')}`;\n\n if (!langString) {\n return `<pre><code>${code}</code></pre>\\n`;\n }\n\n return `<pre><code class=\"language-${langString}\">${code}</code></pre>\\n`;\n },\n // Replaces the checkbox input elements with markdown checkboxes.\n // This is the easiest way to prevent the formatting of markdown checkboxes in lists.\n // This can modify the input string slightly, since the capitalization of the checkbox can be lost.\n // If a user types '- [X]' it will be replaced with '- [x]' => the capitalization is lost.\n checkbox({ checked }: Tokens.Checkbox) {\n return checked ? '[x]' : '[ ]';\n },\n // Ensures that the numbering of ordered lists is preserved.\n listitem: function (item: Tokens.ListItem) {\n if (item.task) {\n return false;\n }\n\n const match = item.raw.trim().match(/^\\d{1,9}[.)]/);\n // Removes the trailing dot or parenthesis from the match.\n const value = match ? match[0].slice(0, match[0].length - 1) : '';\n if (value) {\n let itemBody = '';\n // @ts-ignore\n itemBody += this.parser.parse(item.tokens, !!item.loose);\n // Sets the value attribute of the list item to the number of the list item.\n return `<li value=\"${value}\">${itemBody}</li>\\n`;\n }\n\n // Ensures that the default listitem renderer from marked js is used.\n return false;\n },\n};\n\nconst postprocess = (html: string): string => {\n let tableIndex = 0;\n // Assigns ids to tables.\n const modifiedString = html.replace(/(<table>)/g, () => {\n const result = `<table id=\"${TABLE_ID_PREFIX}${tableIndex}\">`;\n tableIndex++;\n return result;\n });\n\n return modifiedString;\n};\n\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nmarked.use({ tokenizer, renderer, hooks: { postprocess } });\n\n// Parses markdown following the Github Flavored Markdown specification.\n// The tokenizer and renderer are slightly modified to prevent html escaping in code block and inline code.\nexport const parseMarkdown = (text: string, parseBBCode: boolean) =>\n marked.parse(text, {\n walkTokens: (token) => {\n if (parseBBCode && (token.type === 'codespan' || token.type === 'code')) {\n // eslint-disable-next-line no-param-reassign\n (token as Tokens.Codespan).text = escapeBBCodeSquareBrackets(\n (token as Tokens.Codespan).text,\n );\n }\n },\n }) as string;\n\n// It is important that, &amp; is replaced lastly to prevent double escaping.\nconst unescapeHtml = (text: string) =>\n text.replaceAll('&lt;', '<').replaceAll('&gt;', '>').replaceAll('&amp;', '&');\n\nexport const getMarkdownTables = (text: string): TableObject[] => {\n const tableTokens: Tokens.Table[] = [];\n\n marked.parse(text, {\n walkTokens: (token) => {\n if (token.type === 'table') {\n tableTokens.push(token as Tokens.Table);\n }\n },\n }) as string;\n\n const tables: TableObject[] = [];\n\n tableTokens.forEach((tableToken, index) => {\n const tableArray: string[][] = [];\n\n if (tableToken.header?.length > 0) {\n const rowArray: string[] = [];\n\n tableToken.header.forEach((header) => {\n rowArray.push(unescapeHtml(header.text));\n });\n\n tableArray.push(rowArray);\n }\n if (tableToken.rows?.length > 0) {\n tableToken.rows.forEach((row) => {\n const rowArray: string[] = [];\n\n row.forEach((cell) => {\n rowArray.push(unescapeHtml(cell.text));\n });\n\n tableArray.push(rowArray);\n });\n }\n\n const csv = stringify(tableArray || []);\n\n tables.push({\n raw: unescapeHtml(tableToken.raw),\n csv,\n id: `${TABLE_ID_PREFIX}${index}`,\n });\n });\n\n return tables;\n};\n"],"mappings":"AAAA,SAASA,MAAM,QAAgB,QAAQ;AAEvC;AACA,SAASC,SAAS,QAAQ,gCAAgC;AAC1D,SAASC,0BAA0B,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gE,UAAU,IAAI,EAAE,CAAC;IAEvCJ,MAAM,CAACD,IAAI,CAAC;MACRzC,GAAG,EAAEqC,YAAY,CAACO,UAAU,CAAC5C,GAAG,CAAC;MACjCoD,GAAG;MACHC,EAAE,EAAE,GAAGnE,eAAe,GAAG2D,KAAK;IAClC,CAAC,CAAC;EACN,CAAC,CAAC;EAEF,OAAOH,MAAM;AACjB,CAAC","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chayns-components/format",
3
- "version": "5.0.0-beta.1156",
3
+ "version": "5.0.0-beta.1162",
4
4
  "description": "A set of beautiful React components for developing your own applications with chayns.",
5
5
  "sideEffects": false,
6
6
  "browserslist": [
@@ -52,16 +52,16 @@
52
52
  "url": "https://github.com/TobitSoftware/chayns-components/issues"
53
53
  },
54
54
  "devDependencies": {
55
- "@babel/cli": "^7.27.2",
56
- "@babel/core": "^7.27.4",
57
- "@babel/preset-env": "^7.27.2",
55
+ "@babel/cli": "^7.28.0",
56
+ "@babel/core": "^7.28.0",
57
+ "@babel/preset-env": "^7.28.0",
58
58
  "@babel/preset-react": "^7.27.1",
59
59
  "@babel/preset-typescript": "^7.27.1",
60
- "@types/commonmark": "^0.27.9",
60
+ "@types/commonmark": "^0.27.10",
61
61
  "@types/csv-stringify": "^3.1.3",
62
62
  "babel-loader": "^9.2.1",
63
63
  "cross-env": "^7.0.3",
64
- "lerna": "^8.2.2",
64
+ "lerna": "^8.2.3",
65
65
  "typescript": "^5.8.3",
66
66
  "vitest": "^1.6.1"
67
67
  },
@@ -73,5 +73,5 @@
73
73
  "publishConfig": {
74
74
  "access": "public"
75
75
  },
76
- "gitHead": "a8f494822295ba7eaf79139f61d356a58e746bfa"
76
+ "gitHead": "711be48f9db5d545a98736e1c28cc2ab1e0b397c"
77
77
  }