@markdoc/markdoc 0.5.8 → 0.5.10
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/dist/index.js +5 -3
- package/dist/index.js.map +3 -3
- package/dist/index.mjs +5 -3
- package/dist/index.mjs.map +3 -3
- package/dist/src/tokenizer/plugins/annotations.d.ts.map +1 -1
- package/dist/src/types.d.ts +2 -1
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/formatter.test.ts +55 -0
- package/src/formatter.ts +5 -5
- package/src/tokenizer/plugins/annotations.test.ts +126 -0
- package/src/tokenizer/plugins/annotations.ts +4 -1
- package/src/types.ts +3 -1
package/dist/index.js
CHANGED
|
@@ -7308,8 +7308,9 @@ function* formatNode(n, o = {}) {
|
|
|
7308
7308
|
break;
|
|
7309
7309
|
}
|
|
7310
7310
|
case "blockquote": {
|
|
7311
|
-
const prefix = ">" + SPACE;
|
|
7312
|
-
|
|
7311
|
+
const prefix = NL + indent + ">" + SPACE;
|
|
7312
|
+
const inner = n.children.map((child) => format(child, { ...no, indent: 0 }).trim()).join(NL + NL);
|
|
7313
|
+
yield prefix + inner.split(NL).join(prefix) + NL;
|
|
7313
7314
|
break;
|
|
7314
7315
|
}
|
|
7315
7316
|
case "hr": {
|
|
@@ -8335,8 +8336,9 @@ function block(state, startLine, endLine, silent) {
|
|
|
8335
8336
|
const lastPossible = state.src.slice(0, finish).trim().length;
|
|
8336
8337
|
if (!tagEnd || tagEnd < lastPossible - CLOSE.length) return false;
|
|
8337
8338
|
const contentStart = start + OPEN.length;
|
|
8338
|
-
const content = state.src.slice(contentStart, tagEnd).trim();
|
|
8339
8339
|
const lines = state.src.slice(start, tagEnd + CLOSE.length).split("\n").length;
|
|
8340
|
+
const text2 = state.getLines(startLine, startLine + lines, 0, false);
|
|
8341
|
+
const content = text2.slice(text2.indexOf(OPEN) + OPEN.length, findTagEnd(text2)).trim();
|
|
8340
8342
|
if (content[0] === "$") return false;
|
|
8341
8343
|
if (silent) return true;
|
|
8342
8344
|
const token = createToken(state, content, contentStart);
|