File tree Expand file tree Collapse file tree 4 files changed +47
-2
lines changed Expand file tree Collapse file tree 4 files changed +47
-2
lines changed Original file line number Diff line number Diff line change 2323 "build" : " tsdown" ,
2424 "prepare" : " npm run build" ,
2525 "test" : " node --experimental-default-config-file --test --experimental-test-coverage" ,
26- "test:update" : " npm test -- --experimental- test-snapshots" ,
26+ "test:update" : " npm test -- --test-update -snapshots" ,
2727 "lint" : " npm run lint:biome && npm run lint:tsc" ,
2828 "lint:biome" : " biome check ." ,
2929 "lint:tsc" : " tsc -p ./tsconfig.lint.json" ,
Original file line number Diff line number Diff line change @@ -54,9 +54,9 @@ export const convertToNodes: ReturnType<typeof combineNodeParsers> =
5454 NumberListNodeParser ,
5555 CodeNodeParser ,
5656 CommandLineNodeParser ,
57- FormulaNodeParser ,
5857 BlankNodeParser ,
5958 DecorationNodeParser ,
59+ FormulaNodeParser ,
6060 StrongImageNodeParser ,
6161 StrongIconNodeParser ,
6262 StrongNodeParser ,
Original file line number Diff line number Diff line change @@ -17,4 +17,11 @@ describe("formula", () => {
1717 it ( "Formula includes [] without tail half-space" , ( { assert } ) => {
1818 assert . snapshot ( parse ( "[$ [x]]" , { hasTitle : false } ) ) ;
1919 } ) ;
20+
21+ // ref. https://github.com/progfay/scrapbox-parser/issues/1892
22+ it ( "Formula followed immediately by a decoration notation with trailing spaces" , ( {
23+ assert,
24+ } ) => {
25+ assert . snapshot ( parse ( "[$ 1+1=2][. [link] ]" , { hasTitle : false } ) ) ;
26+ } ) ;
2027} ) ;
Original file line number Diff line number Diff line change 1+ exports[`formula > Formula followed immediately by a decoration notation with trailing spaces 1`] = `
2+ [
3+ {
4+ "indent": 0,
5+ "type": "line",
6+ "nodes": [
7+ {
8+ "type": "formula",
9+ "raw": "[$ 1+1=2]",
10+ "formula": "1+1=2"
11+ },
12+ {
13+ "type": "decoration",
14+ "raw": "[. [link] ]",
15+ "rawDecos": ".",
16+ "decos": [
17+ "."
18+ ],
19+ "nodes": [
20+ {
21+ "type": "link",
22+ "raw": "[link]",
23+ "pathType": "relative",
24+ "href": "link",
25+ "content": ""
26+ },
27+ {
28+ "type": "plain",
29+ "raw": " ",
30+ "text": " "
31+ }
32+ ]
33+ }
34+ ]
35+ }
36+ ]
37+ `;
38+
139exports[`formula > Formula includes [] with tail half-space 1`] = `
240[
341 {
You can’t perform that action at this time.
0 commit comments