@yozora/tokenizer-html-block 2.0.0-alpha.1 → 2.0.0-alpha.2
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/lib/cjs/index.js +4 -6
- package/lib/esm/index.js +4 -6
- package/package.json +5 -5
package/lib/cjs/index.js
CHANGED
|
@@ -480,15 +480,13 @@ const match = function () {
|
|
|
480
480
|
}
|
|
481
481
|
};
|
|
482
482
|
|
|
483
|
-
const parse = function () {
|
|
483
|
+
const parse = function (api) {
|
|
484
484
|
return {
|
|
485
485
|
parse: tokens => tokens.map(token => {
|
|
486
486
|
const contents = coreTokenizer.mergeContentLinesFaithfully(token.lines);
|
|
487
|
-
const node =
|
|
488
|
-
type: 'html',
|
|
489
|
-
|
|
490
|
-
value: character.calcStringFromNodePoints(contents),
|
|
491
|
-
};
|
|
487
|
+
const node = api.shouldReservePosition
|
|
488
|
+
? { type: 'html', position: token.position, value: character.calcStringFromNodePoints(contents) }
|
|
489
|
+
: { type: 'html', value: character.calcStringFromNodePoints(contents) };
|
|
492
490
|
return node;
|
|
493
491
|
}),
|
|
494
492
|
};
|
package/lib/esm/index.js
CHANGED
|
@@ -476,15 +476,13 @@ const match = function () {
|
|
|
476
476
|
}
|
|
477
477
|
};
|
|
478
478
|
|
|
479
|
-
const parse = function () {
|
|
479
|
+
const parse = function (api) {
|
|
480
480
|
return {
|
|
481
481
|
parse: tokens => tokens.map(token => {
|
|
482
482
|
const contents = mergeContentLinesFaithfully(token.lines);
|
|
483
|
-
const node =
|
|
484
|
-
type: 'html',
|
|
485
|
-
|
|
486
|
-
value: calcStringFromNodePoints(contents),
|
|
487
|
-
};
|
|
483
|
+
const node = api.shouldReservePosition
|
|
484
|
+
? { type: 'html', position: token.position, value: calcStringFromNodePoints(contents) }
|
|
485
|
+
: { type: 'html', value: calcStringFromNodePoints(contents) };
|
|
488
486
|
return node;
|
|
489
487
|
}),
|
|
490
488
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yozora/tokenizer-html-block",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.2",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "guanghechen",
|
|
6
6
|
"url": "https://github.com/guanghechen/"
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"test": "cross-env TS_NODE_FILES=true jest --config ../../jest.config.js --rootDir ."
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@yozora/ast": "^2.0.0-alpha.
|
|
39
|
-
"@yozora/character": "^2.0.0-alpha.
|
|
40
|
-
"@yozora/core-tokenizer": "^2.0.0-alpha.
|
|
38
|
+
"@yozora/ast": "^2.0.0-alpha.2",
|
|
39
|
+
"@yozora/character": "^2.0.0-alpha.2",
|
|
40
|
+
"@yozora/core-tokenizer": "^2.0.0-alpha.2"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "da59d85520455c59a117a35032ef1a035c10ea21"
|
|
43
43
|
}
|