@limetech/lime-elements 37.19.1 → 37.20.0
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.
- package/CHANGELOG.md +8 -0
- package/dist/cjs/limel-markdown.cjs.entry.js +3 -1
- package/dist/cjs/limel-markdown.cjs.entry.js.map +1 -1
- package/dist/collection/components/markdown/allowed-css-properties.js +2 -0
- package/dist/collection/components/markdown/allowed-css-properties.js.map +1 -1
- package/dist/collection/components/markdown/markdown-parser.js +1 -1
- package/dist/collection/components/markdown/markdown-parser.js.map +1 -1
- package/dist/esm/limel-markdown.entry.js +3 -1
- package/dist/esm/limel-markdown.entry.js.map +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/{p-ad6b52f8.entry.js → p-a8b9ae53.entry.js} +2 -2
- package/dist/lime-elements/{p-ad6b52f8.entry.js.map → p-a8b9ae53.entry.js.map} +1 -1
- package/package.json +1 -1
|
@@ -3,11 +3,13 @@ export const allowedCssProperties = [
|
|
|
3
3
|
'color',
|
|
4
4
|
'font-style',
|
|
5
5
|
'font-weight',
|
|
6
|
+
'height',
|
|
6
7
|
'text-decoration-color',
|
|
7
8
|
'text-decoration-line',
|
|
8
9
|
'text-decoration-skip-ink',
|
|
9
10
|
'text-decoration-style',
|
|
10
11
|
'text-decoration-thickness',
|
|
11
12
|
'text-decoration',
|
|
13
|
+
'width',
|
|
12
14
|
];
|
|
13
15
|
//# sourceMappingURL=allowed-css-properties.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"allowed-css-properties.js","sourceRoot":"","sources":["../../../src/components/markdown/allowed-css-properties.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG;EAChC,kBAAkB;EAClB,OAAO;EACP,YAAY;EACZ,aAAa;EACb,uBAAuB;EACvB,sBAAsB;EACtB,0BAA0B;EAC1B,uBAAuB;EACvB,2BAA2B;EAC3B,iBAAiB;
|
|
1
|
+
{"version":3,"file":"allowed-css-properties.js","sourceRoot":"","sources":["../../../src/components/markdown/allowed-css-properties.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG;EAChC,kBAAkB;EAClB,OAAO;EACP,YAAY;EACZ,aAAa;EACb,QAAQ;EACR,uBAAuB;EACvB,sBAAsB;EACtB,0BAA0B;EAC1B,uBAAuB;EACvB,2BAA2B;EAC3B,iBAAiB;EACjB,OAAO;CACV,CAAC","sourcesContent":["export const allowedCssProperties = [\n 'background-color',\n 'color',\n 'font-style',\n 'font-weight',\n 'height',\n 'text-decoration-color',\n 'text-decoration-line',\n 'text-decoration-skip-ink',\n 'text-decoration-style',\n 'text-decoration-thickness',\n 'text-decoration',\n 'width',\n];\n"]}
|
|
@@ -34,7 +34,7 @@ export async function markdownToHTML(text, options) {
|
|
|
34
34
|
.use(rehypeRaw)
|
|
35
35
|
.use(rehypeSanitize, Object.assign(Object.assign({}, defaultSchema), {
|
|
36
36
|
// Allow the `style` attribute on all elements
|
|
37
|
-
attributes: Object.assign(Object.assign({}, defaultSchema.attributes), { '*': ['style'] })
|
|
37
|
+
attributes: Object.assign(Object.assign({}, defaultSchema.attributes), { '*': ['height', 'style', 'width'] })
|
|
38
38
|
}))
|
|
39
39
|
.use(() => {
|
|
40
40
|
return (tree) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown-parser.js","sourceRoot":"","sources":["../../../src/components/markdown/markdown-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,WAAW,MAAM,cAAc,CAAC;AACvC,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,cAAc,EAAE,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,eAAe,MAAM,kBAAkB,CAAC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kBAAkB,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAChC,IAAY,EACZ,OAA+B;EAE/B,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,mBAAmB,EAAE;IAC9B,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;GAC5C;EAED,MAAM,IAAI,GAAG,MAAM,OAAO,EAAE;KACvB,GAAG,CAAC,WAAW,CAAC;KAChB,GAAG,CAAC,SAAS,CAAC;KACd,GAAG,CAAC,YAAY,EAAE,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC;KAC/C,GAAG,CAAC,mBAAmB,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;KAC9C,GAAG,CAAC,SAAS,CAAC;KACd,GAAG,CAAC,cAAc,kCACZ,aAAa;IAChB,8CAA8C;IAC9C,UAAU,kCACH,aAAa,CAAC,UAAU,KAC3B,GAAG,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,OAEvC;KACD,GAAG,CAAC,GAAG,EAAE;IACN,OAAO,CAAC,IAAS,EAAE,EAAE;MACjB,8DAA8D;MAC9D,uDAAuD;MACvD,KAAK,CAAC,IAAI,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;IAC1C,CAAC,CAAC;EACN,CAAC,CAAC;KACD,GAAG,CAAC,eAAe,CAAC;KACpB,OAAO,CAAC,IAAI,CAAC,CAAC;EAEnB,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;AAC3B,CAAC","sourcesContent":["import { unified } from 'unified';\nimport remarkParse from 'remark-parse';\nimport remarkRehype from 'remark-rehype';\nimport remarkGfm from 'remark-gfm';\nimport rehypeExternalLinks from 'rehype-external-links';\nimport rehypeSanitize, { defaultSchema } from 'rehype-sanitize';\nimport rehypeStringify from 'rehype-stringify';\nimport rehypeRaw from 'rehype-raw';\nimport { visit } from 'unist-util-visit';\nimport { sanitizeStyle } from './sanitize-style';\n\n/**\n * Takes a string as input and returns a new string\n * where the text has been converted to HTML.\n *\n * If the text is formatted with .md markdown, it will\n * be transformed to HTML.\n *\n * If the text already is in HTML it will be sanitized and\n * \"dangerous\" tags such as <script> will be removed.\n *\n * @param text - The string to convert.\n * @param options - Options for the conversions.\n * @returns The resulting HTML.\n */\nexport async function markdownToHTML(\n text: string,\n options?: markdownToHTMLOptions,\n): Promise<string> {\n if (options?.forceHardLineBreaks) {\n text = text.replace(/([\\n\\r])/g, ' $1');\n }\n\n const file = await unified()\n .use(remarkParse)\n .use(remarkGfm)\n .use(remarkRehype, { allowDangerousHtml: true })\n .use(rehypeExternalLinks, { target: '_blank' })\n .use(rehypeRaw)\n .use(rehypeSanitize, {\n ...defaultSchema,\n // Allow the `style` attribute on all elements\n attributes: {\n ...defaultSchema.attributes,\n '*': ['height', 'style', 'width'],\n },\n })\n .use(() => {\n return (tree: any) => {\n // Run the sanitizeStyle function on all elements, to sanitize\n // the value of the `style` attribute, if there is one.\n visit(tree, 'element', sanitizeStyle);\n };\n })\n .use(rehypeStringify)\n .process(text);\n\n return file.toString();\n}\n\n/**\n * Options for markdownToHTML.\n */\nexport interface markdownToHTMLOptions {\n /**\n * Set to `true` to convert all soft line breaks to hard line breaks.\n */\n forceHardLineBreaks?: boolean;\n}\n"]}
|
|
@@ -43600,12 +43600,14 @@ const allowedCssProperties = [
|
|
|
43600
43600
|
'color',
|
|
43601
43601
|
'font-style',
|
|
43602
43602
|
'font-weight',
|
|
43603
|
+
'height',
|
|
43603
43604
|
'text-decoration-color',
|
|
43604
43605
|
'text-decoration-line',
|
|
43605
43606
|
'text-decoration-skip-ink',
|
|
43606
43607
|
'text-decoration-style',
|
|
43607
43608
|
'text-decoration-thickness',
|
|
43608
43609
|
'text-decoration',
|
|
43610
|
+
'width',
|
|
43609
43611
|
];
|
|
43610
43612
|
|
|
43611
43613
|
/**
|
|
@@ -43696,7 +43698,7 @@ async function markdownToHTML(text, options) {
|
|
|
43696
43698
|
.use(rehypeRaw)
|
|
43697
43699
|
.use(rehypeSanitize, Object.assign(Object.assign({}, defaultSchema), {
|
|
43698
43700
|
// Allow the `style` attribute on all elements
|
|
43699
|
-
attributes: Object.assign(Object.assign({}, defaultSchema.attributes), { '*': ['style'] }) }))
|
|
43701
|
+
attributes: Object.assign(Object.assign({}, defaultSchema.attributes), { '*': ['height', 'style', 'width'] }) }))
|
|
43700
43702
|
.use(() => {
|
|
43701
43703
|
return (tree) => {
|
|
43702
43704
|
// Run the sanitizeStyle function on all elements, to sanitize
|