@chayns-components/format
Advanced tools
Comparing version 5.0.0-beta.682 to 5.0.0-beta.683
@@ -187,2 +187,7 @@ "use strict"; | ||
}); | ||
(0, _vitest.test)('should not format 4 spaces as code block', () => { | ||
const result = (0, _formatString.formatStringToHtml)(' const a = 1;'); | ||
(0, _vitest.expect)(result.html).toEqual('<p> const a = 1;</p>'); | ||
(0, _vitest.expect)(result.tables).toEqual([]); | ||
}); | ||
(0, _vitest.describe)('HTML In Code', () => { | ||
@@ -189,0 +194,0 @@ (0, _vitest.test)('should escape < and > within code block', () => { |
@@ -41,8 +41,14 @@ "use strict"; | ||
}, | ||
// Disables Markdown formatting for setext headings. | ||
lheading() { | ||
return undefined; | ||
}, | ||
// Disables converting urls to hyperlinks. | ||
url() { | ||
return undefined; | ||
}, | ||
// Disables converting text with 4 leading spaces to code block. | ||
code() { | ||
return undefined; | ||
}, | ||
// inlineText is overwritten to prevent html escaping, specifically since quote characters are escaped, which breaks the attributes of bb-code elements. | ||
@@ -49,0 +55,0 @@ // The function is copied from marked.js and slightly modified: https://github.com/markedjs/marked/blob/42954aaba960b6f815b24ec0d39da464960e4ec9/src/Tokenizer.ts#L854 |
@@ -185,2 +185,7 @@ import { describe, expect, test } from 'vitest'; | ||
}); | ||
test('should not format 4 spaces as code block', () => { | ||
const result = formatStringToHtml(' const a = 1;'); | ||
expect(result.html).toEqual('<p> const a = 1;</p>'); | ||
expect(result.tables).toEqual([]); | ||
}); | ||
describe('HTML In Code', () => { | ||
@@ -187,0 +192,0 @@ test('should escape < and > within code block', () => { |
@@ -34,8 +34,14 @@ import { marked } from 'marked'; | ||
}, | ||
// Disables Markdown formatting for setext headings. | ||
lheading() { | ||
return undefined; | ||
}, | ||
// Disables converting urls to hyperlinks. | ||
url() { | ||
return undefined; | ||
}, | ||
// Disables converting text with 4 leading spaces to code block. | ||
code() { | ||
return undefined; | ||
}, | ||
// inlineText is overwritten to prevent html escaping, specifically since quote characters are escaped, which breaks the attributes of bb-code elements. | ||
@@ -42,0 +48,0 @@ // The function is copied from marked.js and slightly modified: https://github.com/markedjs/marked/blob/42954aaba960b6f815b24ec0d39da464960e4ec9/src/Tokenizer.ts#L854 |
{ | ||
"name": "@chayns-components/format", | ||
"version": "5.0.0-beta.682", | ||
"version": "5.0.0-beta.683", | ||
"description": "A set of beautiful React components for developing your own applications with chayns.", | ||
@@ -74,3 +74,3 @@ "sideEffects": false, | ||
}, | ||
"gitHead": "f70fcf3c45699b8c5ad2c439112cc1aada012553" | ||
"gitHead": "9ac78b39832e1830f08d7b1efbbf6239946e090d" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
275324
1861