diff --git a/jest.config.mjs b/jest.config.mjs index 43b71f0d..7ecc5eb6 100644 --- a/jest.config.mjs +++ b/jest.config.mjs @@ -1,14 +1,14 @@ -export default { +import { createDefaultPreset } from "ts-jest"; + +/** @type {import("ts-jest").JestConfigWithTsJest} */ +const config = { moduleFileExtensions: ["ts", "js"], transform: { - "^.+\\.(ts|tsx)$": "ts-jest", - }, - globals: { - "ts-jest": { - tsconfig: "tsconfig.json", - }, + ...createDefaultPreset().transform, }, collectCoverageFrom: ["src/**/*.ts"], setupFilesAfterEnv: ["./tests/jest-setup.ts"], testMatch: ["**/tests/**/*.test.ts"], }; + +export default config; diff --git a/tests/codeBlock/__snapshots__/index.test.ts.snap b/tests/codeBlock/__snapshots__/index.test.ts.snap index 0cc352fc..aa1b537e 100644 --- a/tests/codeBlock/__snapshots__/index.test.ts.snap +++ b/tests/codeBlock/__snapshots__/index.test.ts.snap @@ -1,11 +1,11 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Code Block Bulleted code block 1`] = ` -Array [ - Object { +[ + { "content": "function () { alert(document.location.href) - console.log(\\"hello\\") + console.log("hello") // You can also write comments! }", "fileName": "hello.js", @@ -16,11 +16,11 @@ Array [ `; exports[`Code Block Code block with bullet 1`] = ` -Array [ - Object { +[ + { "indent": 1, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "Bullet", "text": "Bullet", "type": "plain", @@ -28,20 +28,20 @@ Array [ ], "type": "line", }, - Object { + { "content": "function () { alert(document.location.href) - console.log(\\"hello\\") + console.log("hello") // You can also write comments! }", "fileName": "hello.js", "indent": 1, "type": "codeBlock", }, - Object { + { "indent": 1, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "Bullet", "text": "Bullet", "type": "plain", @@ -53,21 +53,21 @@ Array [ `; exports[`Code Block Consecutive code blocks 1`] = ` -Array [ - Object { +[ + { "content": "function () { alert(document.location.href) - console.log(\\"hello\\") + console.log("hello") // You can also write comments! }", "fileName": "hello.js", "indent": 0, "type": "codeBlock", }, - Object { + { "content": "function () { alert(document.location.href) - console.log(\\"hello\\") + console.log("hello") // You can also write comments! }", "fileName": "hello.js", @@ -78,11 +78,11 @@ Array [ `; exports[`Code Block Simple code block 1`] = ` -Array [ - Object { +[ + { "content": "function () { alert(document.location.href) - console.log(\\"hello\\") + console.log("hello") // You can also write comments! }", "fileName": "hello.js", diff --git a/tests/line/__snapshots__/blank.test.ts.snap b/tests/line/__snapshots__/blank.test.ts.snap index ac53add4..f698a500 100644 --- a/tests/line/__snapshots__/blank.test.ts.snap +++ b/tests/line/__snapshots__/blank.test.ts.snap @@ -1,11 +1,11 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`blank [] is not blank 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "[]", "text": "[]", "type": "plain", @@ -17,21 +17,21 @@ Array [ `; exports[`blank Blank in the [*** ] 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "[*** ", "text": "[*** ", "type": "plain", }, - Object { + { "raw": "[ ]", "text": " ", "type": "blank", }, - Object { + { "raw": "]", "text": "]", "type": "plain", @@ -43,21 +43,21 @@ Array [ `; exports[`blank Blank in the sentence 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "sentence", "text": "sentence", "type": "plain", }, - Object { + { "raw": "[ ]", "text": " ", "type": "blank", }, - Object { + { "raw": "sentence", "text": "sentence", "type": "plain", @@ -69,11 +69,11 @@ Array [ `; exports[`blank Multi char blank 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "[     ]", "text": "     ", "type": "blank", @@ -85,11 +85,11 @@ Array [ `; exports[`blank Simple double-byte space blank 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "[ ]", "text": " ", "type": "blank", @@ -101,11 +101,11 @@ Array [ `; exports[`blank Simple half-space blank 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "[ ]", "text": " ", "type": "blank", @@ -117,11 +117,11 @@ Array [ `; exports[`blank Simple tab blank 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "[ ]", "text": " ", "type": "blank", diff --git a/tests/line/__snapshots__/bullet.test.ts.snap b/tests/line/__snapshots__/bullet.test.ts.snap index f57387e4..bb600b0d 100644 --- a/tests/line/__snapshots__/bullet.test.ts.snap +++ b/tests/line/__snapshots__/bullet.test.ts.snap @@ -1,11 +1,11 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`bullet Double-byte space indent 1`] = ` -Array [ - Object { +[ + { "indent": 1, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "Double-byte space", "text": "Double-byte space", "type": "plain", @@ -17,11 +17,11 @@ Array [ `; exports[`bullet Multi lines bullet 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "no bullet (indent: 0)", "text": "no bullet (indent: 0)", "type": "plain", @@ -29,10 +29,10 @@ Array [ ], "type": "line", }, - Object { + { "indent": 1, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "first bullet (indent: 1)", "text": "first bullet (indent: 1)", "type": "plain", @@ -40,10 +40,10 @@ Array [ ], "type": "line", }, - Object { + { "indent": 2, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "second bullet (indent: 2)", "text": "second bullet (indent: 2)", "type": "plain", @@ -51,10 +51,10 @@ Array [ ], "type": "line", }, - Object { + { "indent": 3, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "third bullet (indent: 3)", "text": "third bullet (indent: 3)", "type": "plain", @@ -66,11 +66,11 @@ Array [ `; exports[`bullet Single-byte space indent 1`] = ` -Array [ - Object { +[ + { "indent": 1, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "Single-byte space", "text": "Single-byte space", "type": "plain", @@ -82,11 +82,11 @@ Array [ `; exports[`bullet Tab indent 1`] = ` -Array [ - Object { +[ + { "indent": 1, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "Tab", "text": "Tab", "type": "plain", diff --git a/tests/line/__snapshots__/code.test.ts.snap b/tests/line/__snapshots__/code.test.ts.snap index d5775bda..800773db 100644 --- a/tests/line/__snapshots__/code.test.ts.snap +++ b/tests/line/__snapshots__/code.test.ts.snap @@ -1,11 +1,11 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`code Empty code with backquote 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "\`\`", "text": "", "type": "code", @@ -17,11 +17,11 @@ Array [ `; exports[`code Simple code with backquote 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "\`Simple code\`", "text": "Simple code", "type": "code", diff --git a/tests/line/__snapshots__/commandLine.test.ts.snap b/tests/line/__snapshots__/commandLine.test.ts.snap index 82764ea3..1daf5e4f 100644 --- a/tests/line/__snapshots__/commandLine.test.ts.snap +++ b/tests/line/__snapshots__/commandLine.test.ts.snap @@ -1,11 +1,11 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`commandLine \`$ \` is not command 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "$ ", "text": "$ ", "type": "plain", @@ -17,11 +17,11 @@ Array [ `; exports[`commandLine \`$\` is not command 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "$", "text": "$", "type": "plain", @@ -33,11 +33,11 @@ Array [ `; exports[`commandLine \`$s\` is not command 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "$not command", "text": "$not command", "type": "plain", @@ -49,11 +49,11 @@ Array [ `; exports[`commandLine Simple command with $ 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "$ command", "symbol": "$", "text": "command", @@ -66,11 +66,11 @@ Array [ `; exports[`commandLine Simple command with % 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "% command", "symbol": "%", "text": "command", diff --git a/tests/line/__snapshots__/decoration.test.ts.snap b/tests/line/__snapshots__/decoration.test.ts.snap index 06fdd788..ea9cb82b 100644 --- a/tests/line/__snapshots__/decoration.test.ts.snap +++ b/tests/line/__snapshots__/decoration.test.ts.snap @@ -1,16 +1,16 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`decoration Decoration * overflow 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "*-10", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "11*", "text": "11*", "type": "plain", @@ -27,21 +27,21 @@ Array [ `; exports[`decoration Decoration similar with externalLink 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "*-1", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "hoge ", "text": "hoge ", "type": "plain", }, - Object { + { "content": "", "href": "https://example.com", "pathType": "absolute", @@ -60,16 +60,16 @@ Array [ `; exports[`decoration Decoration with hashTag 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "*-1", ], - "nodes": Array [ - Object { + "nodes": [ + { "href": "tag", "raw": "#tag", "type": "hashTag", @@ -86,16 +86,16 @@ Array [ `; exports[`decoration Decoration with icon notation 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "*-1", ], - "nodes": Array [ - Object { + "nodes": [ + { "path": "progfay", "pathType": "relative", "raw": "[progfay.icon]", @@ -113,16 +113,16 @@ Array [ `; exports[`decoration Decoration with many [ 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "!", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "[[[[[[a", "text": "[[[[[[a", "type": "plain", @@ -139,21 +139,21 @@ Array [ `; exports[`decoration Decoration with many [ and link 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "!", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "[[[[[", "text": "[[[[[", "type": "plain", }, - Object { + { "content": "", "href": "a", "pathType": "relative", @@ -172,21 +172,21 @@ Array [ `; exports[`decoration Decoration with strong icon notation (it's just icon, not strong) 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "*-1", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "[", "text": "[", "type": "plain", }, - Object { + { "path": "progfay", "pathType": "relative", "raw": "[progfay.icon]", @@ -197,7 +197,7 @@ Array [ "rawDecos": "*", "type": "decoration", }, - Object { + { "raw": "]", "text": "]", "type": "plain", @@ -209,21 +209,21 @@ Array [ `; exports[`decoration Decoration with strong image notation (it's just image, not strong) 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "*-1", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "[", "text": "[", "type": "plain", }, - Object { + { "link": "", "raw": "[https://example.com/image.png]", "src": "https://example.com/image.png", @@ -234,7 +234,7 @@ Array [ "rawDecos": "*", "type": "decoration", }, - Object { + { "raw": "]", "text": "]", "type": "plain", @@ -246,21 +246,21 @@ Array [ `; exports[`decoration Decoration with strong notation (it's just link) 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "*-1", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "[", "text": "[", "type": "plain", }, - Object { + { "content": "", "href": "link", "pathType": "relative", @@ -272,7 +272,7 @@ Array [ "rawDecos": "*", "type": "decoration", }, - Object { + { "raw": "]", "text": "]", "type": "plain", @@ -284,16 +284,16 @@ Array [ `; exports[`decoration Simple decoration 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "*-1", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "deco", "text": "deco", "type": "plain", @@ -306,15 +306,15 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "*-2", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "deco", "text": "deco", "type": "plain", @@ -327,15 +327,15 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "*-3", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "deco", "text": "deco", "type": "plain", @@ -348,15 +348,15 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "*-4", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "deco", "text": "deco", "type": "plain", @@ -369,15 +369,15 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "*-5", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "deco", "text": "deco", "type": "plain", @@ -390,15 +390,15 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "*-6", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "deco", "text": "deco", "type": "plain", @@ -411,15 +411,15 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "*-7", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "deco", "text": "deco", "type": "plain", @@ -432,15 +432,15 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "*-8", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "deco", "text": "deco", "type": "plain", @@ -453,15 +453,15 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "*-9", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "deco", "text": "deco", "type": "plain", @@ -474,15 +474,15 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "*-10", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "deco", "text": "deco", "type": "plain", @@ -495,15 +495,15 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "!", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "deco", "text": "deco", "type": "plain", @@ -516,36 +516,36 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ - "\\"", + "nodes": [ + { + "decos": [ + """, ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "deco", "text": "deco", "type": "plain", }, ], - "raw": "[\\" deco]", - "rawDecos": "\\"", + "raw": "[" deco]", + "rawDecos": """, "type": "decoration", }, ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "#", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "deco", "text": "deco", "type": "plain", @@ -558,15 +558,15 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "%", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "deco", "text": "deco", "type": "plain", @@ -579,15 +579,15 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "&", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "deco", "text": "deco", "type": "plain", @@ -600,15 +600,15 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "'", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "deco", "text": "deco", "type": "plain", @@ -621,15 +621,15 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "(", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "deco", "text": "deco", "type": "plain", @@ -642,15 +642,15 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ ")", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "deco", "text": "deco", "type": "plain", @@ -663,15 +663,15 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "+", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "deco", "text": "deco", "type": "plain", @@ -684,15 +684,15 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ ",", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "deco", "text": "deco", "type": "plain", @@ -705,15 +705,15 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "-", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "deco", "text": "deco", "type": "plain", @@ -726,15 +726,15 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ ".", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "deco", "text": "deco", "type": "plain", @@ -747,15 +747,15 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "/", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "deco", "text": "deco", "type": "plain", @@ -768,15 +768,15 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "{", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "deco", "text": "deco", "type": "plain", @@ -789,15 +789,15 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "|", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "deco", "text": "deco", "type": "plain", @@ -810,15 +810,15 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "}", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "deco", "text": "deco", "type": "plain", @@ -831,15 +831,15 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "<", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "deco", "text": "deco", "type": "plain", @@ -852,15 +852,15 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ ">", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "deco", "text": "deco", "type": "plain", @@ -873,15 +873,15 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "_", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "deco", "text": "deco", "type": "plain", @@ -894,15 +894,15 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "~", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "deco", "text": "deco", "type": "plain", diff --git a/tests/line/__snapshots__/formula.test.ts.snap b/tests/line/__snapshots__/formula.test.ts.snap index 4b1fc208..ebd568d7 100644 --- a/tests/line/__snapshots__/formula.test.ts.snap +++ b/tests/line/__snapshots__/formula.test.ts.snap @@ -1,11 +1,11 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`formula Formula includes [] with tail half-space 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "formula": "[x]", "raw": "[$ [x] ]", "type": "formula", @@ -17,16 +17,16 @@ Array [ `; exports[`formula Formula includes [] without tail half-space 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "formula": "[x", "raw": "[$ [x]", "type": "formula", }, - Object { + { "raw": "]", "text": "]", "type": "plain", @@ -38,13 +38,13 @@ Array [ `; exports[`formula Simple formula 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { - "formula": "\\\\frac{3}{2}^N", - "raw": "[$ \\\\frac{3}{2}^N]", + "nodes": [ + { + "formula": "\\frac{3}{2}^N", + "raw": "[$ \\frac{3}{2}^N]", "type": "formula", }, ], diff --git a/tests/line/__snapshots__/googleMap.test.ts.snap b/tests/line/__snapshots__/googleMap.test.ts.snap index 8ccef6d7..be05b889 100644 --- a/tests/line/__snapshots__/googleMap.test.ts.snap +++ b/tests/line/__snapshots__/googleMap.test.ts.snap @@ -1,11 +1,11 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`googleMap Simple google map with NE 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "latitude": 35.6812362, "longitude": 139.7649361, "place": "", @@ -21,11 +21,11 @@ Array [ `; exports[`googleMap Simple google map with SW 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "latitude": -13.70533, "longitude": -69.6533372, "place": "", @@ -41,11 +41,11 @@ Array [ `; exports[`googleMap Simple google map with place on left 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "latitude": 35.6812362, "longitude": 139.7649361, "place": "東京駅", @@ -61,11 +61,11 @@ Array [ `; exports[`googleMap Simple google map with place on right 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "latitude": 35.6812362, "longitude": 139.7649361, "place": "東京駅", @@ -81,11 +81,11 @@ Array [ `; exports[`googleMap Simple google map with zoom 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "latitude": 35.6812362, "longitude": 139.7649361, "place": "", diff --git a/tests/line/__snapshots__/hashTag.test.ts.snap b/tests/line/__snapshots__/hashTag.test.ts.snap index d2f667ea..45e65d93 100644 --- a/tests/line/__snapshots__/hashTag.test.ts.snap +++ b/tests/line/__snapshots__/hashTag.test.ts.snap @@ -1,26 +1,26 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`hashTag HashTag in sentence with spaces 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "This is a", "text": "This is a", "type": "plain", }, - Object { + { "raw": " ", "text": " ", "type": "plain", }, - Object { + { "href": "tag", "raw": "#tag", "type": "hashTag", }, - Object { + { "raw": " .", "text": " .", "type": "plain", @@ -32,11 +32,11 @@ Array [ `; exports[`hashTag HashTag in sentence without spaces is not hashTag 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "→#notTag←", "text": "→#notTag←", "type": "plain", @@ -48,11 +48,11 @@ Array [ `; exports[`hashTag HashTag includes \`#\` 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "href": "hash#Tag", "raw": "#hash#Tag", "type": "hashTag", @@ -64,31 +64,31 @@ Array [ `; exports[`hashTag Multiple hashTag 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "href": "hoge", "raw": "#hoge", "type": "hashTag", }, - Object { + { "raw": " ", "text": " ", "type": "plain", }, - Object { + { "href": "fuga", "raw": "#fuga", "type": "hashTag", }, - Object { + { "raw": " ", "text": " ", "type": "plain", }, - Object { + { "href": "piyo", "raw": "#piyo", "type": "hashTag", @@ -100,11 +100,11 @@ Array [ `; exports[`hashTag Only \`#\` is not hashTag 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "#", "text": "#", "type": "plain", @@ -116,11 +116,11 @@ Array [ `; exports[`hashTag Simple hashTag 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "href": "tag", "raw": "#tag", "type": "hashTag", diff --git a/tests/line/__snapshots__/helpfeel.test.ts.snap b/tests/line/__snapshots__/helpfeel.test.ts.snap index 8b624e7b..56945905 100644 --- a/tests/line/__snapshots__/helpfeel.test.ts.snap +++ b/tests/line/__snapshots__/helpfeel.test.ts.snap @@ -1,11 +1,11 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`helpfeel No head \`?\` is not helpfeel 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "a ? not helpfeel", "text": "a ? not helpfeel", "type": "plain", @@ -17,13 +17,13 @@ Array [ `; exports[`helpfeel Quoted ? is not helpfeel 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { - "nodes": Array [ - Object { + "nodes": [ + { + "nodes": [ + { "raw": " ? Quoted", "text": " ? Quoted", "type": "plain", @@ -39,11 +39,11 @@ Array [ `; exports[`helpfeel Simple helpfeel 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "? Simple helpfeel", "text": "Simple helpfeel", "type": "helpfeel", diff --git a/tests/line/__snapshots__/icon.test.ts.snap b/tests/line/__snapshots__/icon.test.ts.snap index 964d3cc0..6a0c96f1 100644 --- a/tests/line/__snapshots__/icon.test.ts.snap +++ b/tests/line/__snapshots__/icon.test.ts.snap @@ -1,18 +1,18 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`icon Icon and internal link on same line 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "content": "", "href": "Internal link", "pathType": "relative", "raw": "[Internal link]", "type": "link", }, - Object { + { "path": "me", "pathType": "relative", "raw": "[me.icon]", @@ -25,23 +25,23 @@ Array [ `; exports[`icon Multiple icons 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "path": "me", "pathType": "relative", "raw": "[me.icon*3]", "type": "icon", }, - Object { + { "path": "me", "pathType": "relative", "raw": "[me.icon*3]", "type": "icon", }, - Object { + { "path": "me", "pathType": "relative", "raw": "[me.icon*3]", @@ -54,11 +54,11 @@ Array [ `; exports[`icon Simple relative icon 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "path": "me", "pathType": "relative", "raw": "[me.icon]", @@ -71,11 +71,11 @@ Array [ `; exports[`icon Simple root icon 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "path": "/icons/+1", "pathType": "root", "raw": "[/icons/+1.icon]", diff --git a/tests/line/__snapshots__/image.test.ts.snap b/tests/line/__snapshots__/image.test.ts.snap index b1bdc053..f902e118 100644 --- a/tests/line/__snapshots__/image.test.ts.snap +++ b/tests/line/__snapshots__/image.test.ts.snap @@ -1,11 +1,11 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`image Direct Gyazo image 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "link": "", "raw": "[https://i.gyazo.com/0f82099330f378fe4917a1b4a5fe8815.png]", "src": "https://i.gyazo.com/0f82099330f378fe4917a1b4a5fe8815.png", @@ -18,11 +18,11 @@ Array [ `; exports[`image Gyazo image 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "link": "", "raw": "[https://gyazo.com/0f82099330f378fe4917a1b4a5fe8815]", "src": "https://gyazo.com/0f82099330f378fe4917a1b4a5fe8815/thumb/1000", @@ -31,10 +31,10 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "link": "", "raw": "[https://i.gyazo.com/0f82099330f378fe4917a1b4a5fe8815]", "src": "https://i.gyazo.com/0f82099330f378fe4917a1b4a5fe8815/thumb/1000", @@ -43,10 +43,10 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "link": "", "raw": "[https://gyazo.com/0f82099330f378fe4917a1b4a5fe8815/raw]", "src": "https://gyazo.com/0f82099330f378fe4917a1b4a5fe8815/raw", @@ -59,11 +59,11 @@ Array [ `; exports[`image Gyazo image with link 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "link": "https://example.com", "raw": "[https://gyazo.com/0f82099330f378fe4917a1b4a5fe8815 https://example.com]", "src": "https://gyazo.com/0f82099330f378fe4917a1b4a5fe8815/thumb/1000", @@ -72,10 +72,10 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "link": "https://example.com", "raw": "[https://example.com https://gyazo.com/0f82099330f378fe4917a1b4a5fe8815]", "src": "https://gyazo.com/0f82099330f378fe4917a1b4a5fe8815/thumb/1000", @@ -84,10 +84,10 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "link": "https://gyazo.com/7057219f5b20ca8afd122945b72453d3", "raw": "[https://gyazo.com/7057219f5b20ca8afd122945b72453d3 https://gyazo.com/0f82099330f378fe4917a1b4a5fe8815]", "src": "https://gyazo.com/0f82099330f378fe4917a1b4a5fe8815/thumb/1000", @@ -100,14 +100,14 @@ Array [ `; exports[`image HTTP jpeg image with special and japanese chars 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "link": "", - "raw": "[http://example.com/~!@#$%^&*()_+\`-={}\\\\'\\"?,.<>|/画像.jpeg]", - "src": "http://example.com/~!@#$%^&*()_+\`-={}\\\\'\\"?,.<>|/画像.jpeg", + "raw": "[http://example.com/~!@#$%^&*()_+\`-={}\\'"?,.<>|/画像.jpeg]", + "src": "http://example.com/~!@#$%^&*()_+\`-={}\\'"?,.<>|/画像.jpeg", "type": "image", }, ], @@ -117,11 +117,11 @@ Array [ `; exports[`image HTTPS svg and GIF image with link 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "link": "https://example.com/", "raw": "[https://example.com/image.svg https://example.com/]", "src": "https://example.com/image.svg", @@ -130,10 +130,10 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "link": "https://example.com/", "raw": "[https://example.com/ https://example.com/image.GIF]", "src": "https://example.com/image.GIF", @@ -146,11 +146,11 @@ Array [ `; exports[`image Image with GET parameters 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "link": "", "raw": "[http://example.com/image.png?key1=value1&key2=value2]", "src": "http://example.com/image.png?key1=value1&key2=value2", @@ -163,11 +163,11 @@ Array [ `; exports[`image Image with double image link 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "link": "https://example.com/forward.png", "raw": "[https://example.com/forward.png https://example.com/backward.png]", "src": "https://example.com/backward.png", @@ -180,11 +180,11 @@ Array [ `; exports[`image Simple image 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "link": "", "raw": "[http://example.com/image.png]", "src": "http://example.com/image.png", @@ -193,10 +193,10 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "link": "", "raw": "[https://example.com/image.JPG]", "src": "https://example.com/image.JPG", diff --git a/tests/line/__snapshots__/index.test.ts.snap b/tests/line/__snapshots__/index.test.ts.snap index 4132c59a..c452a807 100644 --- a/tests/line/__snapshots__/index.test.ts.snap +++ b/tests/line/__snapshots__/index.test.ts.snap @@ -1,16 +1,44 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`line Decoration line includes external link 1`] = ` +[ + { + "indent": 0, + "nodes": [ + { + "decos": [ + "*-1", + ], + "nodes": [ + { + "content": "example", + "href": "https://example.com", + "pathType": "absolute", + "raw": "[https://example.com example]", + "type": "link", + }, + ], + "raw": "[* [https://example.com example]]", + "rawDecos": "*", + "type": "decoration", + }, + ], + "type": "line", + }, +] +`; + exports[`line Decoration line includes internal link 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "*-1", ], - "nodes": Array [ - Object { + "nodes": [ + { "content": "", "href": "Link", "pathType": "relative", @@ -29,16 +57,16 @@ Array [ `; exports[`line Decoration line includes internal link 2`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "*-1", ], - "nodes": Array [ - Object { + "nodes": [ + { "content": "example", "href": "https://example.com", "pathType": "absolute", @@ -57,18 +85,18 @@ Array [ `; exports[`line Line that have multi node 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "content": "", "href": "Link", "pathType": "relative", "raw": "[Link]", "type": "link", }, - Object { + { "content": "", "href": "Link", "pathType": "relative", @@ -82,16 +110,16 @@ Array [ `; exports[`line Multi \`]\` 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "*-1", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "[Link", "text": "[Link", "type": "plain", @@ -101,19 +129,19 @@ Array [ "rawDecos": "*", "type": "decoration", }, - Object { + { "raw": "\`code\`", "text": "code", "type": "code", }, - Object { + { "content": "", "href": "Link", "pathType": "relative", "raw": "[Link]", "type": "link", }, - Object { + { "raw": "]", "text": "]", "type": "plain", diff --git a/tests/line/__snapshots__/link.test.ts.snap b/tests/line/__snapshots__/link.test.ts.snap index 315ed56e..46393c3d 100644 --- a/tests/line/__snapshots__/link.test.ts.snap +++ b/tests/line/__snapshots__/link.test.ts.snap @@ -1,11 +1,11 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`link Link with GET parameters 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "content": "", "href": "http://example.com?key1=value1&key2=value2", "pathType": "absolute", @@ -19,11 +19,11 @@ Array [ `; exports[`link Link with content 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "content": "Example", "href": "https://example.com/", "pathType": "absolute", @@ -33,10 +33,10 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "content": "Example", "href": "https://example.com/", "pathType": "absolute", @@ -46,10 +46,10 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "content": "center https://right.com/", "href": "https://left.com/", "pathType": "absolute", @@ -63,11 +63,11 @@ Array [ `; exports[`link Link with link 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "content": "https://example.com", "href": "https://example.com", "pathType": "absolute", @@ -81,11 +81,11 @@ Array [ `; exports[`link Root and relative link path can include space 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "content": "", "href": "page name", "pathType": "relative", @@ -95,10 +95,10 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "content": "", "href": "/project/page name", "pathType": "root", @@ -112,11 +112,11 @@ Array [ `; exports[`link Simple absolute link 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "content": "", "href": "https://example.com/", "pathType": "absolute", @@ -130,16 +130,16 @@ Array [ `; exports[`link Simple absolute link with ahead non-space character 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "a", "text": "a", "type": "plain", }, - Object { + { "content": "", "href": "https://example.com/", "pathType": "absolute", @@ -153,11 +153,11 @@ Array [ `; exports[`link Simple absolute link with bracket 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "content": "", "href": "https://example.com/", "pathType": "absolute", @@ -171,11 +171,11 @@ Array [ `; exports[`link Simple relative link 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "content": "", "href": "page", "pathType": "relative", @@ -189,11 +189,11 @@ Array [ `; exports[`link Simple root link 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "content": "", "href": "/project/page", "pathType": "root", diff --git a/tests/line/__snapshots__/numberList.test.ts.snap b/tests/line/__snapshots__/numberList.test.ts.snap index 5e155fa8..d9606769 100644 --- a/tests/line/__snapshots__/numberList.test.ts.snap +++ b/tests/line/__snapshots__/numberList.test.ts.snap @@ -1,11 +1,11 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`numberList 1. with no space is not numberList 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "1.", "text": "1.", "type": "plain", @@ -17,11 +17,11 @@ Array [ `; exports[`numberList 1. with no space is not numberList 2`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "1.not numberList", "text": "1.not numberList", "type": "plain", @@ -33,12 +33,12 @@ Array [ `; exports[`numberList Minimum numberList 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { - "nodes": Array [], + "nodes": [ + { + "nodes": [], "number": 1, "raw": "1. ", "rawNumber": "1", @@ -51,11 +51,11 @@ Array [ `; exports[`numberList No head 1. is not numberList 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "a 1. not numberList", "text": "a 1. not numberList", "type": "plain", @@ -67,13 +67,13 @@ Array [ `; exports[`numberList Quoted 1. is not numberList 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { - "nodes": Array [ - Object { + "nodes": [ + { + "nodes": [ + { "raw": " 1. Quoted", "text": " 1. Quoted", "type": "plain", @@ -89,13 +89,13 @@ Array [ `; exports[`numberList Simple numberList 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { - "nodes": Array [ - Object { + "nodes": [ + { + "nodes": [ + { "raw": "Simple numberList", "text": "Simple numberList", "type": "plain", diff --git a/tests/line/__snapshots__/plain.test.ts.snap b/tests/line/__snapshots__/plain.test.ts.snap index c30ee24e..9a695604 100644 --- a/tests/line/__snapshots__/plain.test.ts.snap +++ b/tests/line/__snapshots__/plain.test.ts.snap @@ -1,21 +1,21 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`plain Blank line 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [], + "nodes": [], "type": "line", }, ] `; exports[`plain Keep tail space 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "Tail space -> ", "text": "Tail space -> ", "type": "plain", @@ -27,11 +27,11 @@ Array [ `; exports[`plain Simple plain text 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "Plain text", "text": "Plain text", "type": "plain", diff --git a/tests/line/__snapshots__/quote.test.ts.snap b/tests/line/__snapshots__/quote.test.ts.snap index 1ec872f7..600cb2af 100644 --- a/tests/line/__snapshots__/quote.test.ts.snap +++ b/tests/line/__snapshots__/quote.test.ts.snap @@ -1,12 +1,12 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`quote Empty quote 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { - "nodes": Array [], + "nodes": [ + { + "nodes": [], "raw": ">", "type": "quote", }, @@ -17,13 +17,13 @@ Array [ `; exports[`quote Simple quote 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { - "nodes": Array [ - Object { + "nodes": [ + { + "nodes": [ + { "raw": " Simple quote", "text": " Simple quote", "type": "plain", diff --git a/tests/line/__snapshots__/strong.test.ts.snap b/tests/line/__snapshots__/strong.test.ts.snap index 59847ac7..bd41ebcd 100644 --- a/tests/line/__snapshots__/strong.test.ts.snap +++ b/tests/line/__snapshots__/strong.test.ts.snap @@ -1,11 +1,11 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`strong [[]] is not strong 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "[[]]", "text": "[[]]", "type": "plain", @@ -17,21 +17,21 @@ Array [ `; exports[`strong Decoration in Strong notation 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "[[", "text": "[[", "type": "plain", }, - Object { - "decos": Array [ + { + "decos": [ "!", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "deco", "text": "deco", "type": "plain", @@ -41,7 +41,7 @@ Array [ "rawDecos": "!", "type": "decoration", }, - Object { + { "raw": "]]", "text": "]]", "type": "plain", @@ -53,13 +53,13 @@ Array [ `; exports[`strong Simple strong 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { - "nodes": Array [ - Object { + "nodes": [ + { + "nodes": [ + { "raw": "Simple strong", "text": "Simple strong", "type": "plain", diff --git a/tests/line/__snapshots__/strongIcon.test.ts.snap b/tests/line/__snapshots__/strongIcon.test.ts.snap index 3a8ed4b5..2227ca21 100644 --- a/tests/line/__snapshots__/strongIcon.test.ts.snap +++ b/tests/line/__snapshots__/strongIcon.test.ts.snap @@ -1,23 +1,23 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`strongIcon Multiple icons 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "path": "me", "pathType": "relative", "raw": "[[me.icon*3]]", "type": "strongIcon", }, - Object { + { "path": "me", "pathType": "relative", "raw": "[[me.icon*3]]", "type": "strongIcon", }, - Object { + { "path": "me", "pathType": "relative", "raw": "[[me.icon*3]]", @@ -30,11 +30,11 @@ Array [ `; exports[`strongIcon Simple relative strong icon 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "path": "me", "pathType": "relative", "raw": "[[me.icon]]", @@ -47,11 +47,11 @@ Array [ `; exports[`strongIcon Simple root strong icon 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "path": "/icons/+1", "pathType": "root", "raw": "[[/icons/+1.icon]]", @@ -64,18 +64,18 @@ Array [ `; exports[`strongIcon Strong icon and internal link on same line 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "content": "", "href": "Internal link", "pathType": "relative", "raw": "[Internal link]", "type": "link", }, - Object { + { "path": "me", "pathType": "relative", "raw": "[[me.icon]]", diff --git a/tests/line/__snapshots__/strongImage.test.ts.snap b/tests/line/__snapshots__/strongImage.test.ts.snap index 35a182b8..54b2c6fd 100644 --- a/tests/line/__snapshots__/strongImage.test.ts.snap +++ b/tests/line/__snapshots__/strongImage.test.ts.snap @@ -1,11 +1,11 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`strongImage Direct Gyazo image 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "[[https://i.gyazo.com/0f82099330f378fe4917a1b4a5fe8815.png]]", "src": "https://i.gyazo.com/0f82099330f378fe4917a1b4a5fe8815.png", "type": "strongImage", @@ -17,11 +17,11 @@ Array [ `; exports[`strongImage Gyazo image 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "[[https://gyazo.com/0f82099330f378fe4917a1b4a5fe8815]]", "src": "https://gyazo.com/0f82099330f378fe4917a1b4a5fe8815/thumb/1000", "type": "strongImage", @@ -33,13 +33,13 @@ Array [ `; exports[`strongImage HTTP jpeg strong image with special and japanese chars 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { - "raw": "[[http://example.com/~!@#$%^&*()_+\`-={}\\\\'\\"?,.<>|/画像.jpeg]]", - "src": "http://example.com/~!@#$%^&*()_+\`-={}\\\\'\\"?,.<>|/画像.jpeg", + "nodes": [ + { + "raw": "[[http://example.com/~!@#$%^&*()_+\`-={}\\'"?,.<>|/画像.jpeg]]", + "src": "http://example.com/~!@#$%^&*()_+\`-={}\\'"?,.<>|/画像.jpeg", "type": "strongImage", }, ], @@ -49,11 +49,11 @@ Array [ `; exports[`strongImage Simple strong image 1`] = ` -Array [ - Object { +[ + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "[[http://example.com/image.png]]", "src": "http://example.com/image.png", "type": "strongImage", @@ -61,10 +61,10 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "[[https://example.com/image.JPG]]", "src": "https://example.com/image.JPG", "type": "strongImage", @@ -72,10 +72,10 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "[[https://example.com/image.svg]]", "src": "https://example.com/image.svg", "type": "strongImage", @@ -83,10 +83,10 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "[[https://example.com/image.GIF]]", "src": "https://example.com/image.GIF", "type": "strongImage", diff --git a/tests/line/index.test.ts b/tests/line/index.test.ts index 43984d59..263d24bb 100644 --- a/tests/line/index.test.ts +++ b/tests/line/index.test.ts @@ -7,7 +7,7 @@ describe("line", () => { expect("[* [Link]]").toMatchSnapshotWhenParsing({ hasTitle: false }); }); - it("Decoration line includes internal link", () => { + it("Decoration line includes external link", () => { expect("[* [https://example.com example]]").toMatchSnapshotWhenParsing({ hasTitle: false, }); diff --git a/tests/page/__snapshots__/index.test.ts.snap b/tests/page/__snapshots__/index.test.ts.snap index b7f863ec..f903850f 100644 --- a/tests/page/__snapshots__/index.test.ts.snap +++ b/tests/page/__snapshots__/index.test.ts.snap @@ -1,8 +1,8 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`page Empty page 1`] = ` -Array [ - Object { +[ + { "text": "", "type": "title", }, @@ -10,8 +10,8 @@ Array [ `; exports[`page Title Block without \`hasTitle\` option 1`] = ` -Array [ - Object { +[ + { "text": "Title", "type": "title", }, @@ -19,15 +19,15 @@ Array [ `; exports[`page https://scrapbox.io/help/Syntax 1`] = ` -Array [ - Object { +[ + { "text": "Syntax", "type": "title", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "link": "", "raw": "[https://gyazo.com/0f82099330f378fe4917a1b4a5fe8815]", "src": "https://gyazo.com/0f82099330f378fe4917a1b4a5fe8815/thumb/1000", @@ -36,22 +36,22 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [], + "nodes": [], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [], + "nodes": [], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "nodes": Array [ - Object { + "nodes": [ + { + "nodes": [ + { "raw": "Internal Links", "text": "Internal Links", "type": "plain", @@ -60,7 +60,7 @@ Array [ "raw": "[[Internal Links]]", "type": "strong", }, - Object { + { "raw": " (linking to another page on scrapbox)", "text": " (linking to another page on scrapbox)", "type": "plain", @@ -68,20 +68,20 @@ Array [ ], "type": "line", }, - Object { + { "indent": 1, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "\`[link]\`", "text": "[link]", "type": "code", }, - Object { + { "raw": " ⇒ ", "text": " ⇒ ", "type": "plain", }, - Object { + { "content": "", "href": "Link", "pathType": "relative", @@ -91,17 +91,17 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [], + "nodes": [], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "nodes": Array [ - Object { + "nodes": [ + { + "nodes": [ + { "raw": "External Links", "text": "External Links", "type": "plain", @@ -110,7 +110,7 @@ Array [ "raw": "[[External Links]]", "type": "strong", }, - Object { + { "raw": " (linking to another web page)", "text": " (linking to another web page)", "type": "plain", @@ -118,20 +118,20 @@ Array [ ], "type": "line", }, - Object { + { "indent": 1, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "\`http://google.com\`", "text": "http://google.com", "type": "code", }, - Object { + { "raw": " ⇒ ", "text": " ⇒ ", "type": "plain", }, - Object { + { "content": "", "href": "http://google.com", "pathType": "absolute", @@ -141,20 +141,20 @@ Array [ ], "type": "line", }, - Object { + { "indent": 1, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "\`[http://google.com Google]\`", "text": "[http://google.com Google]", "type": "code", }, - Object { + { "raw": " ⇒ ", "text": " ⇒ ", "type": "plain", }, - Object { + { "content": "Google", "href": "http://google.com", "pathType": "absolute", @@ -164,10 +164,10 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "or", "text": "or", "type": "plain", @@ -175,20 +175,20 @@ Array [ ], "type": "line", }, - Object { + { "indent": 1, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "\`[Google http://google.com]\`", "text": "[Google http://google.com]", "type": "code", }, - Object { + { "raw": " ⇒ ", "text": " ⇒ ", "type": "plain", }, - Object { + { "content": "Google", "href": "http://google.com", "pathType": "absolute", @@ -198,17 +198,17 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [], + "nodes": [], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "nodes": Array [ - Object { + "nodes": [ + { + "nodes": [ + { "raw": "Images", "text": "Images", "type": "plain", @@ -220,15 +220,15 @@ Array [ ], "type": "line", }, - Object { + { "indent": 1, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "Direct image link ↓", "text": "Direct image link ↓", "type": "plain", }, - Object { + { "raw": "\`[https://gyazo.com/da78df293f9e83a74b5402411e2f2e01.png]\`", "text": "[https://gyazo.com/da78df293f9e83a74b5402411e2f2e01.png]", "type": "code", @@ -236,10 +236,10 @@ Array [ ], "type": "line", }, - Object { + { "indent": 1, - "nodes": Array [ - Object { + "nodes": [ + { "link": "", "raw": "[https://i.gyazo.com/da78df293f9e83a74b5402411e2f2e01.png]", "src": "https://i.gyazo.com/da78df293f9e83a74b5402411e2f2e01.png", @@ -248,17 +248,17 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [], + "nodes": [], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "nodes": Array [ - Object { + "nodes": [ + { + "nodes": [ + { "raw": "Clickable Thumbnail Links", "text": "Clickable Thumbnail Links", "type": "plain", @@ -270,20 +270,20 @@ Array [ ], "type": "line", }, - Object { + { "indent": 1, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "↓ ", "text": "↓ ", "type": "plain", }, - Object { + { "raw": "\`[http://cutedog.com https://i.gyazo.com/da78df293f9e83a74b5402411e2f2e01.png]\`", "text": "[http://cutedog.com https://i.gyazo.com/da78df293f9e83a74b5402411e2f2e01.png]", "type": "code", }, - Object { + { "raw": " ", "text": " ", "type": "plain", @@ -291,10 +291,10 @@ Array [ ], "type": "line", }, - Object { + { "indent": 1, - "nodes": Array [ - Object { + "nodes": [ + { "link": "http://cutedog.com", "raw": "[http://cutedog.com https://i.gyazo.com/da78df293f9e83a74b5402411e2f2e01.png]", "src": "https://i.gyazo.com/da78df293f9e83a74b5402411e2f2e01.png", @@ -303,10 +303,10 @@ Array [ ], "type": "line", }, - Object { + { "indent": 1, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "Adding the link at the end also works, as before:", "text": "Adding the link at the end also works, as before:", "type": "plain", @@ -314,10 +314,10 @@ Array [ ], "type": "line", }, - Object { + { "indent": 2, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "\`[https://i.gyazo.com/da78df293f9e83a74b5402411e2f2e01.png http://cutedog.com]\`", "text": "[https://i.gyazo.com/da78df293f9e83a74b5402411e2f2e01.png http://cutedog.com]", "type": "code", @@ -325,17 +325,17 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [], + "nodes": [], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "nodes": Array [ - Object { + "nodes": [ + { + "nodes": [ + { "raw": "Linking to other scrapbox projects", "text": "Linking to other scrapbox projects", "type": "plain", @@ -347,20 +347,20 @@ Array [ ], "type": "line", }, - Object { + { "indent": 1, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "\`[/projectname/pagename]\`", "text": "[/projectname/pagename]", "type": "code", }, - Object { + { "raw": " ⇛ ", "text": " ⇛ ", "type": "plain", }, - Object { + { "content": "", "href": "/icons/check", "pathType": "root", @@ -370,20 +370,20 @@ Array [ ], "type": "line", }, - Object { + { "indent": 1, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "\`[/projectname]\`", "text": "[/projectname]", "type": "code", }, - Object { + { "raw": " ⇛ ", "text": " ⇛ ", "type": "plain", }, - Object { + { "content": "", "href": "/icons", "pathType": "root", @@ -393,17 +393,17 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [], + "nodes": [], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "nodes": Array [ - Object { + "nodes": [ + { + "nodes": [ + { "raw": "Icons", "text": "Icons", "type": "plain", @@ -415,20 +415,20 @@ Array [ ], "type": "line", }, - Object { + { "indent": 1, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "\`[ben.icon]\`", "text": "[ben.icon]", "type": "code", }, - Object { + { "raw": " ⇛ ", "text": " ⇛ ", "type": "plain", }, - Object { + { "path": "ben", "pathType": "relative", "raw": "[ben.icon]", @@ -437,20 +437,20 @@ Array [ ], "type": "line", }, - Object { + { "indent": 1, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "\`[/icons/todo.icon]\`", "text": "[/icons/todo.icon]", "type": "code", }, - Object { + { "raw": " ⇛ ", "text": " ⇛ ", "type": "plain", }, - Object { + { "path": "/icons/todo", "pathType": "root", "raw": "[/icons/todo.icon]", @@ -459,17 +459,17 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [], + "nodes": [], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "nodes": Array [ - Object { + "nodes": [ + { + "nodes": [ + { "raw": "Bold text", "text": "Bold text", "type": "plain", @@ -481,32 +481,32 @@ Array [ ], "type": "line", }, - Object { + { "indent": 1, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "\`[[Bold]]\`", "text": "[[Bold]]", "type": "code", }, - Object { + { "raw": " or ", "text": " or ", "type": "plain", }, - Object { + { "raw": "\`[* Bold]\`", "text": "[* Bold]", "type": "code", }, - Object { + { "raw": "⇒ ", "text": "⇒ ", "type": "plain", }, - Object { - "nodes": Array [ - Object { + { + "nodes": [ + { "raw": "Bold", "text": "Bold", "type": "plain", @@ -518,17 +518,17 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [], + "nodes": [], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "nodes": Array [ - Object { + "nodes": [ + { + "nodes": [ + { "raw": "Italic text", "text": "Italic text", "type": "plain", @@ -540,25 +540,25 @@ Array [ ], "type": "line", }, - Object { + { "indent": 1, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "\`[/ italic]\`", "text": "[/ italic]", "type": "code", }, - Object { + { "raw": "⇛ ", "text": "⇛ ", "type": "plain", }, - Object { - "decos": Array [ + { + "decos": [ "/", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "italic", "text": "italic", "type": "plain", @@ -571,17 +571,17 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [], + "nodes": [], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "nodes": Array [ - Object { + "nodes": [ + { + "nodes": [ + { "raw": " Strikethrough text", "text": " Strikethrough text", "type": "plain", @@ -593,25 +593,25 @@ Array [ ], "type": "line", }, - Object { + { "indent": 1, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "\`[- strikethrough]\`", "text": "[- strikethrough]", "type": "code", }, - Object { + { "raw": "⇛ ", "text": "⇛ ", "type": "plain", }, - Object { - "decos": Array [ + { + "decos": [ "-", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "strikethrough", "text": "strikethrough", "type": "plain", @@ -624,10 +624,10 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "link": "", "raw": "[https://gyazo.com/00ab07461d502db91c8ae170276d1396]", "src": "https://gyazo.com/00ab07461d502db91c8ae170276d1396/thumb/1000", @@ -636,17 +636,17 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [], + "nodes": [], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "nodes": Array [ - Object { + "nodes": [ + { + "nodes": [ + { "raw": "Bullet points", "text": "Bullet points", "type": "plain", @@ -658,10 +658,10 @@ Array [ ], "type": "line", }, - Object { + { "indent": 1, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "Press space or tab on a new line to indent and create a bullet point", "text": "Press space or tab on a new line to indent and create a bullet point", "type": "plain", @@ -669,10 +669,10 @@ Array [ ], "type": "line", }, - Object { + { "indent": 2, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "Press backspace to remove the indent / bullet point", "text": "Press backspace to remove the indent / bullet point", "type": "plain", @@ -680,17 +680,17 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [], + "nodes": [], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "nodes": Array [ - Object { + "nodes": [ + { + "nodes": [ + { "raw": "Internal links serve triple duty", "text": "Internal links serve triple duty", "type": "plain", @@ -702,25 +702,25 @@ Array [ ], "type": "line", }, - Object { + { "indent": 1, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "\`[Links]\`", "text": "[Links]", "type": "code", }, - Object { + { "raw": " or ", "text": " or ", "type": "plain", }, - Object { + { "raw": "\`#links\`", "text": "#links", "type": "code", }, - Object { + { "raw": " are two ways to make links. They do three things", "text": " are two ways to make links. They do three things", "type": "plain", @@ -728,10 +728,10 @@ Array [ ], "type": "line", }, - Object { + { "indent": 2, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "An internal link to a page", "text": "An internal link to a page", "type": "plain", @@ -739,22 +739,22 @@ Array [ ], "type": "line", }, - Object { + { "indent": 2, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "A ", "text": "A ", "type": "plain", }, - Object { + { "content": "", "href": "Bi-directional link", "pathType": "relative", "raw": "[Bi-directional link]", "type": "link", }, - Object { + { "raw": " back to the source", "text": " back to the source", "type": "plain", @@ -762,22 +762,22 @@ Array [ ], "type": "line", }, - Object { + { "indent": 2, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "A ", "text": "A ", "type": "plain", }, - Object { + { "content": "", "href": "2-hop link", "pathType": "relative", "raw": "[2-hop link]", "type": "link", }, - Object { + { "raw": " so you can find more related pages", "text": " so you can find more related pages", "type": "plain", @@ -785,17 +785,17 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [], + "nodes": [], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "nodes": Array [ - Object { + "nodes": [ + { + "nodes": [ + { "raw": "Block quote", "text": "Block quote", "type": "plain", @@ -807,22 +807,22 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "nodes": Array [ - Object { + "nodes": [ + { + "nodes": [ + { "raw": " use the right caret ", "text": " use the right caret ", "type": "plain", }, - Object { + { "raw": "\`>\`", "text": ">", "type": "code", }, - Object { + { "raw": " at the beginning of a line to get a block quote ", "text": " at the beginning of a line to get a block quote ", "type": "plain", @@ -834,20 +834,20 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [], + "nodes": [], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "*-1", ], - "nodes": Array [ - Object { + "nodes": [ + { "raw": "Mouse based styling", "text": "Mouse based styling", "type": "plain", @@ -860,10 +860,10 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { + "nodes": [ + { "link": "", "raw": "[https://gyazo.com/a515ab169b1e371641f7e04bfa92adbc]", "src": "https://gyazo.com/a515ab169b1e371641f7e04bfa92adbc/thumb/1000", @@ -872,12 +872,12 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "nodes": Array [ - Object { + "nodes": [ + { + "nodes": [ + { "content": "", "href": "Code notation", "pathType": "relative", @@ -891,10 +891,10 @@ Array [ ], "type": "line", }, - Object { + { "indent": 1, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "Use backquotes or backticks, \`, to highlight code ", "text": "Use backquotes or backticks, \`, to highlight code ", "type": "plain", @@ -902,15 +902,15 @@ Array [ ], "type": "line", }, - Object { + { "indent": 1, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "e.g. ", "text": "e.g. ", "type": "plain", }, - Object { + { "raw": "\`function() { return true }\`", "text": "function() { return true }", "type": "code", @@ -918,17 +918,17 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [], + "nodes": [], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "nodes": Array [ - Object { + "nodes": [ + { + "nodes": [ + { "content": "", "href": "Code blocks", "pathType": "relative", @@ -942,30 +942,30 @@ Array [ ], "type": "line", }, - Object { + { "indent": 1, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "Typing ", "text": "Typing ", "type": "plain", }, - Object { + { "raw": "\`code:filename.extension\`", "text": "code:filename.extension", "type": "code", }, - Object { + { "raw": "or", "text": "or", "type": "plain", }, - Object { + { "raw": "\`code:filename\`", "text": "code:filename", "type": "code", }, - Object { + { "raw": "can be used to create a new code snippet and and display it as a block", "text": "can be used to create a new code snippet and and display it as a block", "type": "plain", @@ -973,10 +973,10 @@ Array [ ], "type": "line", }, - Object { + { "indent": 2, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "Language names may be abbreviated", "text": "Language names may be abbreviated", "type": "plain", @@ -984,27 +984,27 @@ Array [ ], "type": "line", }, - Object { + { "content": "function () { alert(document.location.href) - console.log(\\"hello\\") + console.log("hello") // You can also write comments! }", "fileName": "hello.js", "indent": 1, "type": "codeBlock", }, - Object { + { "indent": 0, - "nodes": Array [], + "nodes": [], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "nodes": Array [ - Object { + "nodes": [ + { + "nodes": [ + { "content": "", "href": "Tables", "pathType": "relative", @@ -1018,10 +1018,10 @@ Array [ ], "type": "line", }, - Object { + { "indent": 1, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "Type table: tablename to create a table", "text": "Type table: tablename to create a table", "type": "plain", @@ -1029,10 +1029,10 @@ Array [ ], "type": "line", }, - Object { + { "indent": 1, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "Use tab to move to the next column, use enter to move to the next row.", "text": "Use tab to move to the next column, use enter to move to the next row.", "type": "plain", @@ -1040,10 +1040,10 @@ Array [ ], "type": "line", }, - Object { + { "indent": 1, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "An example:", "text": "An example:", "type": "plain", @@ -1051,94 +1051,94 @@ Array [ ], "type": "line", }, - Object { - "cells": Array [ - Array [ - Array [ - Object { + { + "cells": [ + [ + [ + { "raw": "1", "text": "1", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "2", "text": "2", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "3", "text": "3", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "1 ", "text": "1 ", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "2 ", "text": "2 ", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "3", "text": "3", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "------", "text": "------", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "------", "text": "------", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "------", "text": "------", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "a", "text": "a", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "b", "text": "b", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "c", "text": "c", "type": "plain", @@ -1150,25 +1150,25 @@ Array [ "indent": 0, "type": "table", }, - Object { + { "indent": 0, - "nodes": Array [], + "nodes": [], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [], + "nodes": [], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "*-1", ], - "nodes": Array [ - Object { + "nodes": [ + { "content": "", "href": "Mathematical notation", "pathType": "relative", @@ -1183,37 +1183,37 @@ Array [ ], "type": "line", }, - Object { + { "indent": 1, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "Using ", "text": "Using ", "type": "plain", }, - Object { + { "content": "TeX", "href": "https://en.wikipedia.org/wiki/TeX", "pathType": "absolute", "raw": "[TeX https://en.wikipedia.org/wiki/TeX]", "type": "link", }, - Object { + { "raw": " inside of brackets with a dollar sign ", "text": " inside of brackets with a dollar sign ", "type": "plain", }, - Object { + { "raw": "\`[$ TeX here ]\`", "text": "[$ TeX here ]", "type": "code", }, - Object { + { "raw": ", you can format math or science formulas, like so: ", "text": ", you can format math or science formulas, like so: ", "type": "plain", }, - Object { + { "formula": "E = mc^2", "raw": "[$ E = mc^2]", "type": "formula", @@ -1221,20 +1221,20 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [], + "nodes": [], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [ - Object { - "decos": Array [ + "nodes": [ + { + "decos": [ "*-1", ], - "nodes": Array [ - Object { + "nodes": [ + { "content": "", "href": "Userscript", "pathType": "relative", @@ -1249,10 +1249,10 @@ Array [ ], "type": "line", }, - Object { + { "indent": 1, - "nodes": Array [ - Object { + "nodes": [ + { "raw": "You can even add javascript to customize Scrapbox to your liking.", "text": "You can even add javascript to customize Scrapbox to your liking.", "type": "plain", @@ -1260,9 +1260,9 @@ Array [ ], "type": "line", }, - Object { + { "indent": 0, - "nodes": Array [], + "nodes": [], "type": "line", }, ] diff --git a/tests/table/__snapshots__/index.test.ts.snap b/tests/table/__snapshots__/index.test.ts.snap index bbdad1d4..a56aa14a 100644 --- a/tests/table/__snapshots__/index.test.ts.snap +++ b/tests/table/__snapshots__/index.test.ts.snap @@ -1,95 +1,95 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Table Bulleted table 1`] = ` -Array [ - Object { - "cells": Array [ - Array [ - Array [ - Object { +[ + { + "cells": [ + [ + [ + { "raw": "1", "text": "1", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "2", "text": "2", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "3", "text": "3", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "1 ", "text": "1 ", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "2 ", "text": "2 ", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "3", "text": "3", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "------", "text": "------", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "------", "text": "------", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "------", "text": "------", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "a", "text": "a", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "b", "text": "b", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "c", "text": "c", "type": "plain", @@ -105,95 +105,95 @@ Array [ `; exports[`Table Consecutive table 1`] = ` -Array [ - Object { - "cells": Array [ - Array [ - Array [ - Object { +[ + { + "cells": [ + [ + [ + { "raw": "1", "text": "1", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "2", "text": "2", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "3", "text": "3", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "1 ", "text": "1 ", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "2 ", "text": "2 ", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "3", "text": "3", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "------", "text": "------", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "------", "text": "------", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "------", "text": "------", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "a", "text": "a", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "b", "text": "b", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "c", "text": "c", "type": "plain", @@ -205,94 +205,94 @@ Array [ "indent": 0, "type": "table", }, - Object { - "cells": Array [ - Array [ - Array [ - Object { + { + "cells": [ + [ + [ + { "raw": "1", "text": "1", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "2", "text": "2", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "3", "text": "3", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "1 ", "text": "1 ", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "2 ", "text": "2 ", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "3", "text": "3", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "------", "text": "------", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "------", "text": "------", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "------", "text": "------", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "a", "text": "a", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "b", "text": "b", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "c", "text": "c", "type": "plain", @@ -308,129 +308,129 @@ Array [ `; exports[`Table Node in table cells 1`] = ` -Array [ - Object { - "cells": Array [ - Array [ - Array [ - Object { +[ + { + "cells": [ + [ + [ + { "raw": "#hashtag", "text": "#hashtag", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "[* deco]", "text": "[* deco]", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "[ ]", "text": "[ ]", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "\`code\`", "text": "\`code\`", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "https://external.com", "text": "https://external.com", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "[https://external.com]", "text": "[https://external.com]", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "[left https://external.com]", "text": "[left https://external.com]", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "[https://external.com right]", "text": "[https://external.com right]", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "[$ x]", "text": "[$ x]", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "[N35.6812362,E139.7649361]", "text": "[N35.6812362,E139.7649361]", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "#hashTag", "text": "#hashTag", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "? helpfeel", "text": "? helpfeel", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "$ commandLine", "text": "$ commandLine", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "path": "progfay", "pathType": "relative", "raw": "[progfay.icon]", @@ -438,18 +438,18 @@ Array [ }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "[https://image.com/image.png]", "text": "[https://image.com/image.png]", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "content": "", "href": "link", "pathType": "relative", @@ -458,45 +458,45 @@ Array [ }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "plain", "text": "plain", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "> quote", "text": "> quote", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "[[progfay.icon]]", "text": "[[progfay.icon]]", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "[[https://image.com/image.png]]", "text": "[[https://image.com/image.png]]", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "[[strong]]", "text": "[[strong]]", "type": "plain", @@ -512,95 +512,95 @@ Array [ `; exports[`Table Simple table 1`] = ` -Array [ - Object { - "cells": Array [ - Array [ - Array [ - Object { +[ + { + "cells": [ + [ + [ + { "raw": "1", "text": "1", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "2", "text": "2", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "3", "text": "3", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "1 ", "text": "1 ", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "2 ", "text": "2 ", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "3", "text": "3", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "------", "text": "------", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "------", "text": "------", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "------", "text": "------", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "a", "text": "a", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "b", "text": "b", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "c", "text": "c", "type": "plain", @@ -616,89 +616,89 @@ Array [ `; exports[`Table Staggered table 1`] = ` -Array [ - Object { - "cells": Array [ - Array [ - Array [ - Object { +[ + { + "cells": [ + [ + [ + { "raw": "1", "text": "1", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "2", "text": "2", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "3", "text": "3", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "4", "text": "4", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "1", "text": "1", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "2", "text": "2", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "3", "text": "3", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "1", "text": "1", "type": "plain", }, ], ], - Array [ - Array [ - Object { + [ + [ + { "raw": "1", "text": "1", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": "2", "text": "2", "type": "plain", }, ], ], - Array [ - Array [], + [ + [], ], ], "fileName": "Staggered", @@ -709,36 +709,36 @@ Array [ `; exports[`Table Table with empty cells 1`] = ` -Array [ - Object { - "cells": Array [ - Array [ - Array [ - Object { +[ + { + "cells": [ + [ + [ + { "raw": " ", "text": " ", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": " ", "text": " ", "type": "plain", }, ], - Array [ - Object { + [ + { "raw": " ", "text": " ", "type": "plain", }, ], ], - Array [ - Array [], - Array [], - Array [], + [ + [], + [], + [], ], ], "fileName": " ",