remark-mdat 1.1.1 → 1.1.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/dist/.DS_Store +0 -0
- package/dist/index.js +30 -50
- package/package.json +9 -9
package/dist/.DS_Store
CHANGED
|
Binary file
|
package/dist/index.js
CHANGED
|
@@ -150,8 +150,7 @@ var require_utils = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/cli-table3@
|
|
|
150
150
|
break;
|
|
151
151
|
case "center": {
|
|
152
152
|
let right = Math.ceil(padlen / 2);
|
|
153
|
-
|
|
154
|
-
str = repeat(pad$1, left) + str + repeat(pad$1, right);
|
|
153
|
+
str = repeat(pad$1, padlen - right) + str + repeat(pad$1, right);
|
|
155
154
|
break;
|
|
156
155
|
}
|
|
157
156
|
default:
|
|
@@ -541,8 +540,7 @@ var require_supports_colors = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/@
|
|
|
541
540
|
return min;
|
|
542
541
|
}
|
|
543
542
|
function getSupportLevel(stream) {
|
|
544
|
-
|
|
545
|
-
return translateLevel(level$1);
|
|
543
|
+
return translateLevel(supportsColor(stream));
|
|
546
544
|
}
|
|
547
545
|
module.exports = {
|
|
548
546
|
supportsColor: getSupportLevel,
|
|
@@ -1451,13 +1449,12 @@ var require_layout_manager = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/cl
|
|
|
1451
1449
|
let yMin1 = cell1.y;
|
|
1452
1450
|
let yMax1 = cell1.y - 1 + (cell1.rowSpan || 1);
|
|
1453
1451
|
let yMin2 = cell2.y;
|
|
1454
|
-
let
|
|
1455
|
-
let yConflict = !(yMin1 > yMax2 || yMin2 > yMax1);
|
|
1452
|
+
let yConflict = !(yMin1 > cell2.y - 1 + (cell2.rowSpan || 1) || yMin2 > yMax1);
|
|
1456
1453
|
let xMin1 = cell1.x;
|
|
1457
1454
|
let xMax1 = cell1.x - 1 + (cell1.colSpan || 1);
|
|
1458
1455
|
let xMin2 = cell2.x;
|
|
1459
|
-
let
|
|
1460
|
-
return yConflict &&
|
|
1456
|
+
let xConflict = !(xMin1 > cell2.x - 1 + (cell2.colSpan || 1) || xMin2 > xMax1);
|
|
1457
|
+
return yConflict && xConflict;
|
|
1461
1458
|
}
|
|
1462
1459
|
function conflictExists(rows, x, y) {
|
|
1463
1460
|
let i_max = Math.min(rows.length - 1, y);
|
|
@@ -1702,7 +1699,7 @@ var require_cli_table3 = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/cli-ta
|
|
|
1702
1699
|
}) });
|
|
1703
1700
|
|
|
1704
1701
|
//#endregion
|
|
1705
|
-
//#region node_modules/.pnpm/unist-util-is@6.0.
|
|
1702
|
+
//#region node_modules/.pnpm/unist-util-is@6.0.1/node_modules/unist-util-is/lib/index.js
|
|
1706
1703
|
/**
|
|
1707
1704
|
* Generate an assertion from a test.
|
|
1708
1705
|
*
|
|
@@ -1724,7 +1721,7 @@ var require_cli_table3 = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/cli-ta
|
|
|
1724
1721
|
const convert = (function(test) {
|
|
1725
1722
|
if (test === null || test === void 0) return ok$1;
|
|
1726
1723
|
if (typeof test === "function") return castFactory(test);
|
|
1727
|
-
if (typeof test === "object") return Array.isArray(test) ? anyFactory(test) :
|
|
1724
|
+
if (typeof test === "object") return Array.isArray(test) ? anyFactory(test) : propertiesFactory(test);
|
|
1728
1725
|
if (typeof test === "string") return typeFactory(test);
|
|
1729
1726
|
throw new Error("Expected function, string, or object as test");
|
|
1730
1727
|
});
|
|
@@ -1754,7 +1751,7 @@ function anyFactory(tests) {
|
|
|
1754
1751
|
* @param {Props} check
|
|
1755
1752
|
* @returns {Check}
|
|
1756
1753
|
*/
|
|
1757
|
-
function
|
|
1754
|
+
function propertiesFactory(check) {
|
|
1758
1755
|
const checkAsRecord = check;
|
|
1759
1756
|
return castFactory(all$2);
|
|
1760
1757
|
/**
|
|
@@ -1812,7 +1809,7 @@ function looksLikeANode(value) {
|
|
|
1812
1809
|
}
|
|
1813
1810
|
|
|
1814
1811
|
//#endregion
|
|
1815
|
-
//#region node_modules/.pnpm/unist-util-visit-parents@6.0.
|
|
1812
|
+
//#region node_modules/.pnpm/unist-util-visit-parents@6.0.2/node_modules/unist-util-visit-parents/lib/color.node.js
|
|
1816
1813
|
/**
|
|
1817
1814
|
* @param {string} d
|
|
1818
1815
|
* @returns {string}
|
|
@@ -1822,7 +1819,7 @@ function color(d) {
|
|
|
1822
1819
|
}
|
|
1823
1820
|
|
|
1824
1821
|
//#endregion
|
|
1825
|
-
//#region node_modules/.pnpm/unist-util-visit-parents@6.0.
|
|
1822
|
+
//#region node_modules/.pnpm/unist-util-visit-parents@6.0.2/node_modules/unist-util-visit-parents/lib/index.js
|
|
1826
1823
|
/** @type {Readonly<ActionTuple>} */
|
|
1827
1824
|
const empty = [];
|
|
1828
1825
|
/**
|
|
@@ -2140,8 +2137,7 @@ function mdatMessageToLogString(sourcePath, mdatMessage) {
|
|
|
2140
2137
|
const { column: column$1, level: level$1, line: line$1, message, source: source$1 } = mdatMessage;
|
|
2141
2138
|
const resolvedSource = source$1 ? picocolors.gray(`[${source$1}] `) : "";
|
|
2142
2139
|
const lineColumn = line$1 && column$1 ? `:${line$1}:${column$1}` : "";
|
|
2143
|
-
|
|
2144
|
-
return `${resolvedSource}${highlightedMessage} ${picocolors.whiteBright(sourcePath + lineColumn)}`;
|
|
2140
|
+
return `${resolvedSource}${highlightComments(message, level$1)} ${picocolors.whiteBright(sourcePath + lineColumn)}`;
|
|
2145
2141
|
}
|
|
2146
2142
|
function highlightComments(text$4, level$1) {
|
|
2147
2143
|
return text$4.replaceAll(/<!--.+-->/g, (match) => level$1 === "info" ? picocolors.green(match) : level$1 === "warn" ? picocolors.yellow(match) : picocolors.red(match));
|
|
@@ -2191,7 +2187,7 @@ var require_parse = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/json5@2.2.3
|
|
|
2191
2187
|
let token;
|
|
2192
2188
|
let key;
|
|
2193
2189
|
let root$1;
|
|
2194
|
-
module.exports = function parse$
|
|
2190
|
+
module.exports = function parse$4(text$4, reviver) {
|
|
2195
2191
|
source = String(text$4);
|
|
2196
2192
|
parseState = "start";
|
|
2197
2193
|
stack = [];
|
|
@@ -2930,7 +2926,7 @@ var require_parse = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/json5@2.2.3
|
|
|
2930
2926
|
//#region node_modules/.pnpm/json5@2.2.3/node_modules/json5/lib/stringify.js
|
|
2931
2927
|
var require_stringify = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/json5@2.2.3/node_modules/json5/lib/stringify.js": ((exports, module) => {
|
|
2932
2928
|
const util = require_util();
|
|
2933
|
-
module.exports = function stringify
|
|
2929
|
+
module.exports = function stringify(value, replacer, space) {
|
|
2934
2930
|
const stack$1 = [];
|
|
2935
2931
|
let indent$1 = "";
|
|
2936
2932
|
let propertyList;
|
|
@@ -3096,11 +3092,9 @@ var require_stringify = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/json5@2
|
|
|
3096
3092
|
//#endregion
|
|
3097
3093
|
//#region node_modules/.pnpm/json5@2.2.3/node_modules/json5/lib/index.js
|
|
3098
3094
|
var require_lib = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/json5@2.2.3/node_modules/json5/lib/index.js": ((exports, module) => {
|
|
3099
|
-
const parse$4 = require_parse();
|
|
3100
|
-
const stringify = require_stringify();
|
|
3101
3095
|
const JSON5 = {
|
|
3102
|
-
parse:
|
|
3103
|
-
stringify
|
|
3096
|
+
parse: require_parse(),
|
|
3097
|
+
stringify: require_stringify()
|
|
3104
3098
|
};
|
|
3105
3099
|
module.exports = JSON5;
|
|
3106
3100
|
}) });
|
|
@@ -3621,7 +3615,7 @@ function getSoleRuleKey(rules) {
|
|
|
3621
3615
|
* that are only supposed to contain a single rule.
|
|
3622
3616
|
* @param record The record to get the sole entry from
|
|
3623
3617
|
* @returns The value of the sole entry in the record
|
|
3624
|
-
* @throws If there are no entries or more than one entry
|
|
3618
|
+
* @throws {Error} If there are no entries or more than one entry
|
|
3625
3619
|
*/
|
|
3626
3620
|
function getSoleRecord(record) {
|
|
3627
3621
|
const recordValues = Object.values(record);
|
|
@@ -3825,9 +3819,7 @@ const emptyOptions$2 = {};
|
|
|
3825
3819
|
*/
|
|
3826
3820
|
function toString(value, options) {
|
|
3827
3821
|
const settings = options || emptyOptions$2;
|
|
3828
|
-
|
|
3829
|
-
const includeHtml = typeof settings.includeHtml === "boolean" ? settings.includeHtml : true;
|
|
3830
|
-
return one$1(value, includeImageAlt, includeHtml);
|
|
3822
|
+
return one$1(value, typeof settings.includeImageAlt === "boolean" ? settings.includeImageAlt : true, typeof settings.includeHtml === "boolean" ? settings.includeHtml : true);
|
|
3831
3823
|
}
|
|
3832
3824
|
/**
|
|
3833
3825
|
* One node or several nodes.
|
|
@@ -12739,8 +12731,7 @@ function createTokenizer(parser, initialize, from) {
|
|
|
12739
12731
|
function start(code$2) {
|
|
12740
12732
|
const left = code$2 !== null && map$4[code$2];
|
|
12741
12733
|
const all$2 = code$2 !== null && map$4.null;
|
|
12742
|
-
|
|
12743
|
-
return handleListOfConstructs(list$3)(code$2);
|
|
12734
|
+
return handleListOfConstructs([...Array.isArray(left) ? left : left ? [left] : [], ...Array.isArray(all$2) ? all$2 : all$2 ? [all$2] : []])(code$2);
|
|
12744
12735
|
}
|
|
12745
12736
|
}
|
|
12746
12737
|
/**
|
|
@@ -13288,10 +13279,7 @@ function compiler(options) {
|
|
|
13288
13279
|
const listStack = [];
|
|
13289
13280
|
let index$1 = -1;
|
|
13290
13281
|
while (++index$1 < events.length) if (events[index$1][1].type === "listOrdered" || events[index$1][1].type === "listUnordered") if (events[index$1][0] === "enter") listStack.push(index$1);
|
|
13291
|
-
else
|
|
13292
|
-
const tail = listStack.pop();
|
|
13293
|
-
index$1 = prepareList(events, tail, index$1);
|
|
13294
|
-
}
|
|
13282
|
+
else index$1 = prepareList(events, listStack.pop(), index$1);
|
|
13295
13283
|
index$1 = -1;
|
|
13296
13284
|
while (++index$1 < events.length) {
|
|
13297
13285
|
const handler = config[events[index$1][0]];
|
|
@@ -17257,8 +17245,7 @@ function gfmTableToMarkdown(options) {
|
|
|
17257
17245
|
* @param {TableRow} node
|
|
17258
17246
|
*/
|
|
17259
17247
|
function handleTableRow(node$1, _, state, info$1) {
|
|
17260
|
-
const
|
|
17261
|
-
const value = serializeData([row]);
|
|
17248
|
+
const value = serializeData([handleTableRowAsData(node$1, state, info$1)]);
|
|
17262
17249
|
return value.slice(0, value.indexOf("\n"));
|
|
17263
17250
|
}
|
|
17264
17251
|
/**
|
|
@@ -19721,7 +19708,7 @@ async function mdatExpand(tree, file, options) {
|
|
|
19721
19708
|
keywordPrefix,
|
|
19722
19709
|
metaCommentIdentifier
|
|
19723
19710
|
});
|
|
19724
|
-
if (commentMarker
|
|
19711
|
+
if (commentMarker?.type === "open" && rules[commentMarker.keyword] !== void 0) commentMarkers.push(commentMarker);
|
|
19725
19712
|
});
|
|
19726
19713
|
commentMarkers.sort((a, b) => rules[a.keyword].applicationOrder - rules[b.keyword].applicationOrder);
|
|
19727
19714
|
for (const comment of commentMarkers) {
|
|
@@ -26283,8 +26270,7 @@ var Parser = class {
|
|
|
26283
26270
|
}
|
|
26284
26271
|
if (!token$1.location) return;
|
|
26285
26272
|
const siblings = this.treeAdapter.getChildNodes(parent);
|
|
26286
|
-
const
|
|
26287
|
-
const textNode = siblings[textNodeIdx - 1];
|
|
26273
|
+
const textNode = siblings[(beforeElement ? siblings.lastIndexOf(beforeElement) : siblings.length) - 1];
|
|
26288
26274
|
if (this.treeAdapter.getNodeSourceCodeLocation(textNode)) {
|
|
26289
26275
|
const { endLine, endCol, endOffset } = token$1.location;
|
|
26290
26276
|
this.treeAdapter.updateNodeSourceCodeLocation(textNode, {
|
|
@@ -26499,8 +26485,7 @@ var Parser = class {
|
|
|
26499
26485
|
}
|
|
26500
26486
|
/** @protected */
|
|
26501
26487
|
_isSpecialElement(element$1, id) {
|
|
26502
|
-
|
|
26503
|
-
return SPECIAL_ELEMENTS[ns].has(id);
|
|
26488
|
+
return SPECIAL_ELEMENTS[this.treeAdapter.getNamespaceURI(element$1)].has(id);
|
|
26504
26489
|
}
|
|
26505
26490
|
/** @internal */
|
|
26506
26491
|
onCharacter(token$1) {
|
|
@@ -26987,8 +26972,7 @@ function aaRecreateElementFromEntry(p, elementEntry) {
|
|
|
26987
26972
|
return newElement;
|
|
26988
26973
|
}
|
|
26989
26974
|
function aaInsertLastNodeInCommonAncestor(p, commonAncestor, lastElement) {
|
|
26990
|
-
const
|
|
26991
|
-
const tid = getTagID(tn);
|
|
26975
|
+
const tid = getTagID(p.treeAdapter.getTagName(commonAncestor));
|
|
26992
26976
|
if (p._isElementCausesFosterParenting(tid)) p._fosterParentElement(lastElement);
|
|
26993
26977
|
else {
|
|
26994
26978
|
const ns = p.treeAdapter.getNamespaceURI(commonAncestor);
|
|
@@ -28868,12 +28852,11 @@ function fromHtml(value, options) {
|
|
|
28868
28852
|
const file = value instanceof VFile ? value : new VFile(value);
|
|
28869
28853
|
const parseFunction = settings.fragment ? parseFragment : parse;
|
|
28870
28854
|
const document$2 = String(file);
|
|
28871
|
-
|
|
28855
|
+
return fromParse5(parseFunction(document$2, {
|
|
28872
28856
|
sourceCodeLocationInfo: true,
|
|
28873
28857
|
onParseError: settings.onerror ? internalOnerror : null,
|
|
28874
28858
|
scriptingEnabled: false
|
|
28875
|
-
})
|
|
28876
|
-
return fromParse5(p5Document, {
|
|
28859
|
+
}), {
|
|
28877
28860
|
file,
|
|
28878
28861
|
space: settings.space,
|
|
28879
28862
|
verbose: settings.verbose
|
|
@@ -28945,8 +28928,7 @@ function fromHtml(value, options) {
|
|
|
28945
28928
|
*/
|
|
28946
28929
|
function formatC(_, $1, $2) {
|
|
28947
28930
|
const offset = ($2 ? Number.parseInt($2, 10) : 0) * ($1 === "-" ? -1 : 1);
|
|
28948
|
-
|
|
28949
|
-
return visualizeCharacter(char);
|
|
28931
|
+
return visualizeCharacter(document$2.charAt(error.startOffset + offset));
|
|
28950
28932
|
}
|
|
28951
28933
|
/**
|
|
28952
28934
|
* Format the character code.
|
|
@@ -29214,11 +29196,10 @@ function mergeRecords$1(values, utils$2, meta) {
|
|
|
29214
29196
|
const propValues = [];
|
|
29215
29197
|
for (const value of values) if (objectHasProperty(value, key$1)) propValues.push(value[key$1]);
|
|
29216
29198
|
if (propValues.length === 0) continue;
|
|
29217
|
-
const
|
|
29199
|
+
const propertyResult = mergeUnknowns(propValues, utils$2, utils$2.metaDataUpdater(meta, {
|
|
29218
29200
|
key: key$1,
|
|
29219
29201
|
parents: values
|
|
29220
|
-
});
|
|
29221
|
-
const propertyResult = mergeUnknowns(propValues, utils$2, updatedMeta);
|
|
29202
|
+
}));
|
|
29222
29203
|
if (propertyResult === actions.skip) continue;
|
|
29223
29204
|
if (key$1 === "__proto__") Object.defineProperty(result, key$1, {
|
|
29224
29205
|
value: propertyResult,
|
|
@@ -29390,8 +29371,7 @@ function stripUndefinedDeep(object) {
|
|
|
29390
29371
|
}, {});
|
|
29391
29372
|
}
|
|
29392
29373
|
function deepMergeDefined(...objects) {
|
|
29393
|
-
|
|
29394
|
-
return deepmerge(...stripped);
|
|
29374
|
+
return deepmerge(...objects.map((v, i) => i === 0 ? v : stripUndefinedDeep(v)));
|
|
29395
29375
|
}
|
|
29396
29376
|
|
|
29397
29377
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "remark-mdat",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "A remark plugin implementing the Markdown Autophagic Template (MDAT) system.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mdat",
|
|
@@ -35,28 +35,28 @@
|
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@types/mdast": "^4.0.4",
|
|
38
|
-
"@types/node": "^20.19.
|
|
38
|
+
"@types/node": "^20.19.24",
|
|
39
39
|
"@types/unist": "^3.0.3",
|
|
40
40
|
"picocolors": "^1.1.1",
|
|
41
|
-
"type-fest": "^5.0
|
|
41
|
+
"type-fest": "^5.2.0",
|
|
42
42
|
"unified": "^11.0.5",
|
|
43
43
|
"vfile": "^6.0.3",
|
|
44
44
|
"zod": "^3.25.76"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@kitschpatrol/shared-config": "^5.7.
|
|
48
|
-
"bumpp": "^10.
|
|
47
|
+
"@kitschpatrol/shared-config": "^5.7.4",
|
|
48
|
+
"bumpp": "^10.3.1",
|
|
49
49
|
"cli-table3": "^0.6.5",
|
|
50
50
|
"deepmerge-ts": "^7.1.5",
|
|
51
51
|
"hast-util-from-html": "^2.0.3",
|
|
52
52
|
"json5": "^2.2.3",
|
|
53
53
|
"remark": "^15.0.1",
|
|
54
54
|
"remark-gfm": "^4.0.1",
|
|
55
|
-
"tsdown": "^0.15.
|
|
56
|
-
"typescript": "~5.9.
|
|
55
|
+
"tsdown": "^0.15.12",
|
|
56
|
+
"typescript": "~5.9.3",
|
|
57
57
|
"unist-util-visit": "^5.0.0",
|
|
58
58
|
"vfile-message": "^4.0.3",
|
|
59
|
-
"vitest": "^
|
|
59
|
+
"vitest": "^4.0.6"
|
|
60
60
|
},
|
|
61
61
|
"engines": {
|
|
62
62
|
"node": ">=20.19.0"
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"dev": "pnpm run test",
|
|
71
71
|
"fix": "ksc fix",
|
|
72
72
|
"lint": "ksc lint",
|
|
73
|
-
"release": "bumpp --commit 'Release: %s' && pnpm run build &&
|
|
73
|
+
"release": "bumpp --commit 'Release: %s' && pnpm run build && NPM_AUTH_TOKEN=$(op read 'op://Personal/npm/token') && pnpm publish",
|
|
74
74
|
"test": "vitest"
|
|
75
75
|
}
|
|
76
76
|
}
|