@limetech/lime-elements 37.57.5 → 37.57.6
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 +19 -0
- package/dist/cjs/limel-markdown.cjs.entry.js +1 -1
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +1 -1
- package/dist/cjs/{markdown-parser-ae3795b9.js → markdown-parser-38bfbd42.js} +27 -16
- package/dist/cjs/{markdown-parser-ae3795b9.js.map → markdown-parser-38bfbd42.js.map} +1 -1
- package/dist/esm/limel-markdown.entry.js +1 -1
- package/dist/esm/limel-prosemirror-adapter.entry.js +1 -1
- package/dist/esm/{markdown-parser-453ad769.js → markdown-parser-a51f65f6.js} +27 -16
- package/dist/esm/{markdown-parser-453ad769.js.map → markdown-parser-a51f65f6.js.map} +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/{p-19405595.entry.js → p-1bbb0dca.entry.js} +2 -2
- package/dist/lime-elements/{p-ba3d2850.js → p-379b68fd.js} +2 -2
- package/dist/lime-elements/{p-ba3d2850.js.map → p-379b68fd.js.map} +1 -1
- package/dist/lime-elements/{p-cf66a132.entry.js → p-b054f9de.entry.js} +2 -2
- package/package.json +1 -1
- /package/dist/lime-elements/{p-19405595.entry.js.map → p-1bbb0dca.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-cf66a132.entry.js.map → p-b054f9de.entry.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
## [37.57.6](https://github.com/Lundalogik/lime-elements/compare/v37.57.5...v37.57.6) (2024-09-05)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
* **markdown:** do not crash when html tag contains blank line ([c8090ab](https://github.com/Lundalogik/lime-elements/commit/c8090ab18d8c6f36b8752213926d9f3257f0f7c6))
|
|
8
|
+
When the markdown component is fed html in which there is a blank line
|
|
9
|
+
(2 consecutive line breaks) anywhere between the opening bracket and
|
|
10
|
+
the closing bracket, the components crashes. Update the sub-dependency
|
|
11
|
+
`hast-util-raw` to avoid this. The parser now switches to text-mode
|
|
12
|
+
when this happens, which will output the rest of the html after the
|
|
13
|
+
blank line, up until the closing bracket, as text. So it still will
|
|
14
|
+
not render the html element correctly, but at least the parser does
|
|
15
|
+
not crash, and the rest of the content after the element's closing
|
|
16
|
+
bracket will be rendered correctly.
|
|
17
|
+
|
|
18
|
+
fix: #3149
|
|
19
|
+
|
|
1
20
|
## [37.57.5](https://github.com/Lundalogik/lime-elements/compare/v37.57.4...v37.57.5) (2024-09-05)
|
|
2
21
|
|
|
3
22
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d1052409.js');
|
|
6
|
-
const markdownParser = require('./markdown-parser-
|
|
6
|
+
const markdownParser = require('./markdown-parser-38bfbd42.js');
|
|
7
7
|
require('./_commonjsHelpers-0c557e26.js');
|
|
8
8
|
|
|
9
9
|
const markdownCss = "@charset \"UTF-8\";code{font-family:ui-monospace, \"Cascadia Code\", \"Source Code Pro\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace;font-size:0.8125rem;letter-spacing:-0.0125rem;color:rgb(var(--contrast-1300));-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;display:inline-block;border-radius:0.25rem;padding:0.03125rem 0.25rem;background-color:rgb(var(--contrast-600))}pre>code{display:block;margin:0.5rem 0;padding:0.5rem 0.75rem;overflow:auto;white-space:pre-wrap}h1{font-size:1.5rem}h2{font-size:1.25rem}h3{font-size:1.125rem}h4{font-size:1rem}h5{font-size:0.875rem}h6{font-size:0.75rem}h1,h2{margin-top:0.5rem;margin-bottom:0.5rem;letter-spacing:-0.03125rem;font-weight:500}h3,h4{margin-top:0.75rem;margin-bottom:0.25rem;font-weight:600}h5,h6{margin-top:0.5rem;margin-bottom:0.125rem;font-weight:600}h1,h2,h3,h4,h5,h6{word-break:break-word;hyphens:auto;-webkit-hyphens:auto}:not([contenteditable=true]) h1,:not([contenteditable=true]) h2,:not([contenteditable=true]) h3,:not([contenteditable=true]) h4,:not([contenteditable=true]) h5,:not([contenteditable=true]) h6{text-wrap:balance}[contenteditable=true] h1,[contenteditable=true] h2,[contenteditable=true] h3,[contenteditable=true] h4,[contenteditable=true] h5,[contenteditable=true] h6{text-wrap:initial}:host(limel-markdown.truncate-paragraphs) p{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}p,li{font-size:0.875rem;word-break:break-word;hyphens:auto;-webkit-hyphens:auto}a{word-break:break-all}p{margin-top:0;margin-bottom:0.5rem}p:only-child{margin-bottom:0}a{transition:color 0.2s ease;color:var(--markdown-hyperlink-color, rgb(var(--color-blue-dark)));text-decoration:none}a:hover{color:var(--markdown-hyperlink-color--hovered, rgb(var(--color-blue-default)))}hr{margin:1.75rem 0 2rem 0;border-width:0;border-top:1px solid rgb(var(--contrast-500))}ul{list-style:none}ul li{position:relative;margin-left:0.75rem}ul li:before{content:\"\";position:absolute;left:-0.5rem;top:0.5rem;width:0.25rem;height:0.25rem;border-radius:50%;background-color:rgb(var(--contrast-700));display:block}ol{margin-top:0.25rem;padding-left:1rem}ul{margin-top:0.25rem;padding-left:0}ul ul,ul ol,ol ol,ol ul{margin-left:0}li{margin-bottom:0.25rem}:host(limel-markdown:not(.no-table-styles)) table{table-layout:auto;min-width:100%;border-collapse:collapse;border-spacing:0;background:transparent;margin:0.75rem 0;border:1px solid rgb(var(--contrast-400))}:host(limel-markdown:not(.no-table-styles)) th,:host(limel-markdown:not(.no-table-styles)) td{text-align:left;vertical-align:top;transition:background-color 0.2s ease;font-size:0.875rem}:host(limel-markdown:not(.no-table-styles)) td{padding:0.5rem 0.375rem 0.75rem 0.375rem}:host(limel-markdown:not(.no-table-styles)) tr th{background-color:rgb(var(--contrast-400));padding:0.25rem 0.375rem;font-weight:normal}:host(limel-markdown:not(.no-table-styles)) tr th:only-child{text-align:center}:host(limel-markdown:not(.no-table-styles)) tbody tr:nth-child(odd) td{background-color:rgb(var(--contrast-200))}:host(limel-markdown:not(.no-table-styles)) tbody tr:hover td{background-color:rgb(var(--contrast-300))}blockquote{position:relative;font-weight:100;font-size:0.875rem;max-width:100%;line-height:1.4;margin:0;padding:0.5rem 1.25rem;border-radius:0.05rem 0.75rem;background-color:rgb(var(--contrast-300))}blockquote:before,blockquote:after{position:absolute;font-size:2.75rem;opacity:0.4}blockquote:before{content:\"“\";left:0;top:-0.75rem}blockquote:after{content:\"”\";right:0;bottom:-2rem}dl{display:grid;grid-template-columns:1fr 2fr;grid-template-rows:1fr;margin-bottom:2rem;border:1px solid rgb(var(--contrast-400));border-radius:0.375rem;background-color:rgb(var(--contrast-200))}dl dt,dl dd{padding:0.375rem 0.5rem;font-size:0.875rem;margin:0}dl dt:nth-of-type(even),dl dd:nth-of-type(even){background-color:rgb(var(--contrast-300))}dl dt:first-child{border-top-left-radius:0.375rem}dl dt:last-child{border-bottom-left-radius:0.375rem}dl dd:first-child{border-top-right-radius:0.375rem}dl dd:last-child{border-bottom-right-radius:0.375rem}hr{border-top:1px solid rgb(var(--contrast-700))}img{max-width:100%}.MsoNormal{margin:0}";
|
|
@@ -9,7 +9,7 @@ const _getAllKeysIn = require('./_getAllKeysIn-bcf08d3b.js');
|
|
|
9
9
|
const isObject$1 = require('./isObject-e28b7997.js');
|
|
10
10
|
const isArray = require('./isArray-d188a04f.js');
|
|
11
11
|
const isObjectLike = require('./isObjectLike-3e3f0cba.js');
|
|
12
|
-
const markdownParser = require('./markdown-parser-
|
|
12
|
+
const markdownParser = require('./markdown-parser-38bfbd42.js');
|
|
13
13
|
const translations = require('./translations-6d759b59.js');
|
|
14
14
|
const randomString = require('./random-string-c8445652.js');
|
|
15
15
|
const isItem = require('./isItem-3f8ad629.js');
|
|
@@ -42678,6 +42678,8 @@ function zwitch(key, options) {
|
|
|
42678
42678
|
* @typedef {import('hast').RootContent} RootContent
|
|
42679
42679
|
* @typedef {import('hast').Text} Text
|
|
42680
42680
|
*
|
|
42681
|
+
* @typedef {import('hast-util-raw').Options} Options
|
|
42682
|
+
*
|
|
42681
42683
|
* @typedef {import('mdast-util-to-hast').Raw} Raw
|
|
42682
42684
|
*
|
|
42683
42685
|
* @typedef {import('parse5').DefaultTreeAdapterMap} DefaultTreeAdapterMap
|
|
@@ -42689,8 +42691,6 @@ function zwitch(key, options) {
|
|
|
42689
42691
|
* @typedef {import('parse5').Token.TagToken} TagToken
|
|
42690
42692
|
*
|
|
42691
42693
|
* @typedef {import('unist').Point} Point
|
|
42692
|
-
*
|
|
42693
|
-
* @typedef {import('vfile').VFile} VFile
|
|
42694
42694
|
*/
|
|
42695
42695
|
|
|
42696
42696
|
// Node types associated with MDX.
|
|
@@ -42835,6 +42835,15 @@ function element(node, state) {
|
|
|
42835
42835
|
* Nothing.
|
|
42836
42836
|
*/
|
|
42837
42837
|
function text(node, state) {
|
|
42838
|
+
// Allow `DATA` through `PLAINTEXT`,
|
|
42839
|
+
// but when hanging in a tag for example,
|
|
42840
|
+
// switch back to `DATA`.
|
|
42841
|
+
// Note: `State` is not exposed by `parse5`, so these numbers are fragile.
|
|
42842
|
+
// See: <https://github.com/inikulin/parse5/blob/46cba43/packages/parse5/lib/tokenizer/index.ts#L58>
|
|
42843
|
+
if (state.parser.tokenizer.state > 4) {
|
|
42844
|
+
state.parser.tokenizer.state = 0;
|
|
42845
|
+
}
|
|
42846
|
+
|
|
42838
42847
|
/** @type {CharacterToken} */
|
|
42839
42848
|
const token = {
|
|
42840
42849
|
type: TokenType.CHARACTER,
|
|
@@ -43157,6 +43166,8 @@ function setPoint(state, point) {
|
|
|
43157
43166
|
* Nothing.
|
|
43158
43167
|
*/
|
|
43159
43168
|
function startTag(node, state) {
|
|
43169
|
+
const tagName = node.tagName.toLowerCase();
|
|
43170
|
+
|
|
43160
43171
|
// Ignore tags if we’re in plain text.
|
|
43161
43172
|
if (state.parser.tokenizer.state === TokenizerMode.PLAINTEXT) return
|
|
43162
43173
|
|
|
@@ -43165,7 +43176,7 @@ function startTag(node, state) {
|
|
|
43165
43176
|
const current = state.parser.openElements.current;
|
|
43166
43177
|
let ns = 'namespaceURI' in current ? current.namespaceURI : webNamespaces$1.html;
|
|
43167
43178
|
|
|
43168
|
-
if (ns === webNamespaces$1.html &&
|
|
43179
|
+
if (ns === webNamespaces$1.html && tagName === 'svg') {
|
|
43169
43180
|
ns = webNamespaces$1.svg;
|
|
43170
43181
|
}
|
|
43171
43182
|
|
|
@@ -43174,19 +43185,18 @@ function startTag(node, state) {
|
|
|
43174
43185
|
{...node, children: []},
|
|
43175
43186
|
{space: ns === webNamespaces$1.svg ? 'svg' : 'html'}
|
|
43176
43187
|
);
|
|
43177
|
-
// Always element.
|
|
43178
|
-
/* c8 ignore next */
|
|
43179
|
-
const attrs = 'attrs' in result ? result.attrs : [];
|
|
43180
43188
|
|
|
43181
43189
|
/** @type {TagToken} */
|
|
43182
43190
|
const tag = {
|
|
43183
43191
|
type: TokenType.START_TAG,
|
|
43184
|
-
tagName
|
|
43185
|
-
tagID: getTagID(
|
|
43192
|
+
tagName,
|
|
43193
|
+
tagID: getTagID(tagName),
|
|
43186
43194
|
// We always send start and end tags.
|
|
43187
43195
|
selfClosing: false,
|
|
43188
43196
|
ackSelfClosing: false,
|
|
43189
|
-
|
|
43197
|
+
// Always element.
|
|
43198
|
+
/* c8 ignore next */
|
|
43199
|
+
attrs: 'attrs' in result ? result.attrs : [],
|
|
43190
43200
|
location: createParse5Location(node)
|
|
43191
43201
|
};
|
|
43192
43202
|
|
|
@@ -43206,7 +43216,7 @@ function startTag(node, state) {
|
|
|
43206
43216
|
// do, such as:
|
|
43207
43217
|
|
|
43208
43218
|
// Set a tag name, similar to how the tokenizer would do it.
|
|
43209
|
-
state.parser.tokenizer.lastStartTagName =
|
|
43219
|
+
state.parser.tokenizer.lastStartTagName = tagName;
|
|
43210
43220
|
|
|
43211
43221
|
// `inForeignNode` is correctly set by the parser.
|
|
43212
43222
|
}
|
|
@@ -43222,10 +43232,11 @@ function startTag(node, state) {
|
|
|
43222
43232
|
* Nothing.
|
|
43223
43233
|
*/
|
|
43224
43234
|
function endTag(node, state) {
|
|
43235
|
+
const tagName = node.tagName.toLowerCase();
|
|
43225
43236
|
// Do not emit closing tags for HTML void elements.
|
|
43226
43237
|
if (
|
|
43227
43238
|
!state.parser.tokenizer.inForeignNode &&
|
|
43228
|
-
htmlVoidElements.includes(
|
|
43239
|
+
htmlVoidElements.includes(tagName)
|
|
43229
43240
|
) {
|
|
43230
43241
|
return
|
|
43231
43242
|
}
|
|
@@ -43238,8 +43249,8 @@ function endTag(node, state) {
|
|
|
43238
43249
|
/** @type {TagToken} */
|
|
43239
43250
|
const tag = {
|
|
43240
43251
|
type: TokenType.END_TAG,
|
|
43241
|
-
tagName
|
|
43242
|
-
tagID: getTagID(
|
|
43252
|
+
tagName,
|
|
43253
|
+
tagID: getTagID(tagName),
|
|
43243
43254
|
selfClosing: false,
|
|
43244
43255
|
ackSelfClosing: false,
|
|
43245
43256
|
attrs: [],
|
|
@@ -43265,7 +43276,7 @@ function endTag(node, state) {
|
|
|
43265
43276
|
// tags:
|
|
43266
43277
|
if (
|
|
43267
43278
|
// Current element is closed.
|
|
43268
|
-
|
|
43279
|
+
tagName === state.parser.tokenizer.lastStartTagName &&
|
|
43269
43280
|
// `<textarea>` and `<title>`
|
|
43270
43281
|
(state.parser.tokenizer.state === TokenizerMode.RCDATA ||
|
|
43271
43282
|
// `<iframe>`, `<noembed>`, `<style>`, `<xmp>`
|
|
@@ -43290,7 +43301,7 @@ function documentMode(node) {
|
|
|
43290
43301
|
return Boolean(
|
|
43291
43302
|
head &&
|
|
43292
43303
|
(head.type === 'doctype' ||
|
|
43293
|
-
(head.type === 'element' && head.tagName === 'html'))
|
|
43304
|
+
(head.type === 'element' && head.tagName.toLowerCase() === 'html'))
|
|
43294
43305
|
)
|
|
43295
43306
|
}
|
|
43296
43307
|
|
|
@@ -44158,4 +44169,4 @@ async function markdownToHTML(text, options) {
|
|
|
44158
44169
|
exports.decodeHTML = decodeHTML;
|
|
44159
44170
|
exports.markdownToHTML = markdownToHTML;
|
|
44160
44171
|
|
|
44161
|
-
//# sourceMappingURL=markdown-parser-
|
|
44172
|
+
//# sourceMappingURL=markdown-parser-38bfbd42.js.map
|