@limaformat/lima 0.8.0 → 0.8.1
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 +9 -0
- package/dist/block-cursor.d.ts +15 -0
- package/dist/block-cursor.js +46 -0
- package/dist/block.d.ts +10 -2
- package/dist/block.js +294 -283
- package/dist/builder.d.ts +18 -0
- package/dist/flow.d.ts +6 -4
- package/dist/flow.js +19 -7
- package/dist/outline.js +138 -229
- package/dist/scalars.d.ts +2 -0
- package/dist/scalars.js +20 -15
- package/package.json +1 -1
package/dist/scalars.js
CHANGED
|
@@ -436,19 +436,8 @@ export const unescapeDQ = (s, strict = false, line = 0) => {
|
|
|
436
436
|
}
|
|
437
437
|
});
|
|
438
438
|
};
|
|
439
|
-
/**
|
|
440
|
-
|
|
441
|
-
* escapes left as written. This is the *physical* form a References 2.0
|
|
442
|
-
* token's column is measured against (§2.4): the comment is not part of
|
|
443
|
-
* the value (so its `${…}`-shaped text must not be scanned as a token),
|
|
444
|
-
* but a `\#` before a token still occupies its two source columns.
|
|
445
|
-
*
|
|
446
|
-
* `trimEnd()` is exactly the project whitespace set (ECMAScript WhiteSpace
|
|
447
|
-
* + LineTerminator = `isTrimWhitespace`) — a U+00A0 / FEFF between the
|
|
448
|
-
* value and the `#` is not part of the value. The Rust and Go ports must
|
|
449
|
-
* use `is_trim_whitespace` here, not a host `trim_end` or `" \t"`.
|
|
450
|
-
*/
|
|
451
|
-
export const stripCommentKeepEscapes = (val) => {
|
|
439
|
+
/** UTF-16 offset of the first unescaped, unquoted hash, or -1. */
|
|
440
|
+
export const commentStart = (val) => {
|
|
452
441
|
let quote = 0;
|
|
453
442
|
for (let i = 0; i < val.length; i++) {
|
|
454
443
|
const cc = val.charCodeAt(i);
|
|
@@ -465,10 +454,26 @@ export const stripCommentKeepEscapes = (val) => {
|
|
|
465
454
|
i++;
|
|
466
455
|
}
|
|
467
456
|
else if (cc === 35) {
|
|
468
|
-
return
|
|
457
|
+
return i;
|
|
469
458
|
}
|
|
470
459
|
}
|
|
471
|
-
return
|
|
460
|
+
return -1;
|
|
461
|
+
};
|
|
462
|
+
/**
|
|
463
|
+
* The value text with a trailing `#` comment removed, but with `\#`
|
|
464
|
+
* escapes left as written. This is the *physical* form a References 2.0
|
|
465
|
+
* token's column is measured against (§2.4): the comment is not part of
|
|
466
|
+
* the value (so its `${…}`-shaped text must not be scanned as a token),
|
|
467
|
+
* but a `\#` before a token still occupies its two source columns.
|
|
468
|
+
*
|
|
469
|
+
* `trimEnd()` is exactly the project whitespace set (ECMAScript WhiteSpace
|
|
470
|
+
* + LineTerminator = `isTrimWhitespace`) — a U+00A0 / FEFF between the
|
|
471
|
+
* value and the `#` is not part of the value. The Rust and Go ports must
|
|
472
|
+
* use `is_trim_whitespace` here, not a host `trim_end` or `" \t"`.
|
|
473
|
+
*/
|
|
474
|
+
export const stripCommentKeepEscapes = (val) => {
|
|
475
|
+
const start = commentStart(val);
|
|
476
|
+
return start === -1 ? val : val.slice(0, start).trimEnd();
|
|
472
477
|
};
|
|
473
478
|
/**
|
|
474
479
|
* The value text with a trailing `#` comment removed and each `\#` *outside*
|
package/package.json
CHANGED