@limaformat/lima 0.2.0 → 0.3.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 +9 -0
- package/README.md +1 -1
- package/dist/reference-tokens2.js +3 -3
- package/dist/references2.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -12,6 +12,15 @@ are both frozen regardless of what this file shows.
|
|
|
12
12
|
|
|
13
13
|
## [Unreleased]
|
|
14
14
|
|
|
15
|
+
## [0.3.0] — 2026-08-12
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- **Breaking:** References 2.0 document references now use `${key}`, while
|
|
20
|
+
partial references use `$(key)`. The briefly published `$(key)` document
|
|
21
|
+
syntax is therefore reinterpreted as a partial reference; `$(:key)` is
|
|
22
|
+
literal text.
|
|
23
|
+
|
|
15
24
|
## [0.2.0] — 2026-08-11
|
|
16
25
|
|
|
17
26
|
### Changed
|
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@ Three functions are exported:
|
|
|
39
39
|
|
|
40
40
|
- `parseCore(input, options?)` — the base format only.
|
|
41
41
|
- `parse(input, options?)` — the primary References 2.0 parser; adds
|
|
42
|
-
`$
|
|
42
|
+
`${key}` document references and `$(key)` external partials.
|
|
43
43
|
- `parseReferences(input, options?)` — deprecated compatibility alias for
|
|
44
44
|
`parse` with the same References 2.0 semantics.
|
|
45
45
|
|
|
@@ -2,11 +2,11 @@ const SEGMENT = '[a-zA-Z0-9_][a-zA-Z0-9_:-]*';
|
|
|
2
2
|
const DOC_PATH = `${SEGMENT}(?:\\.${SEGMENT})*`;
|
|
3
3
|
const PARTIAL_NAME = '[a-zA-Z0-9_][a-zA-Z0-9_:/-]*';
|
|
4
4
|
const PARTIAL_PATH = `${PARTIAL_NAME}(?:\\.${SEGMENT})*`;
|
|
5
|
-
export const PURE_REFERENCE_2 = new RegExp(
|
|
6
|
-
const REFERENCE_2 = new RegExp(`\\$\\(
|
|
5
|
+
export const PURE_REFERENCE_2 = new RegExp(`^(?:\\$\\{(${DOC_PATH})\\}|\\$\\((${PARTIAL_PATH})\\))$`);
|
|
6
|
+
const REFERENCE_2 = new RegExp(`\\$\\{(${DOC_PATH})\\}|\\$\\((${PARTIAL_PATH})\\)`, 'g');
|
|
7
7
|
const NO_TOKENS = [];
|
|
8
8
|
export const scanReferenceTokens2 = (value, firstLine, sourceSpans) => {
|
|
9
|
-
if (!value.includes('$('))
|
|
9
|
+
if (!value.includes('${') && !value.includes('$('))
|
|
10
10
|
return NO_TOKENS;
|
|
11
11
|
REFERENCE_2.lastIndex = 0;
|
|
12
12
|
const result = [];
|
package/dist/references2.js
CHANGED
|
@@ -246,7 +246,7 @@ export const parse = (frontMatter, options) => {
|
|
|
246
246
|
return parseCore(frontMatter, options);
|
|
247
247
|
}
|
|
248
248
|
const partials = validatePartials(options?.partials ?? {});
|
|
249
|
-
if (!frontMatter.includes('$(')) {
|
|
249
|
+
if (!frontMatter.includes('${') && !frontMatter.includes('$(')) {
|
|
250
250
|
return parseCore(frontMatter, options);
|
|
251
251
|
}
|
|
252
252
|
const document = parseCoreWithPositions(frontMatter, { strict: options?.strict ?? false, onWarning: options?.onWarning });
|
package/package.json
CHANGED