@quartz-community/remark-obsidian 2.2.2 → 2.2.4
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 +27 -3
- package/dist/index.js.map +1 -1
- package/dist/legacy.js +4 -2
- package/dist/legacy.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5885,7 +5885,9 @@ function factory3(type) {
|
|
|
5885
5885
|
apply.reset = reset;
|
|
5886
5886
|
reset.test = test;
|
|
5887
5887
|
apply.test = test;
|
|
5888
|
+
var original = value2;
|
|
5888
5889
|
value2 = value2.slice(subvalue.length);
|
|
5890
|
+
var remaining = value2;
|
|
5889
5891
|
updatePosition(subvalue);
|
|
5890
5892
|
indent2 = indent2();
|
|
5891
5893
|
return apply;
|
|
@@ -5896,14 +5898,14 @@ function factory3(type) {
|
|
|
5896
5898
|
var node2 = apply.apply(null, arguments);
|
|
5897
5899
|
line = current.line;
|
|
5898
5900
|
column = current.column;
|
|
5899
|
-
value2 = subvalue + value2;
|
|
5901
|
+
value2 = value2 === remaining ? original : subvalue + value2;
|
|
5900
5902
|
return node2;
|
|
5901
5903
|
}
|
|
5902
5904
|
function test() {
|
|
5903
5905
|
var result = pos({});
|
|
5904
5906
|
line = current.line;
|
|
5905
5907
|
column = current.column;
|
|
5906
|
-
value2 = subvalue + value2;
|
|
5908
|
+
value2 = value2 === remaining ? original : subvalue + value2;
|
|
5907
5909
|
return result.position;
|
|
5908
5910
|
}
|
|
5909
5911
|
}
|
|
@@ -16983,7 +16985,7 @@ function remarkObsidian(userOpts) {
|
|
|
16983
16985
|
}
|
|
16984
16986
|
return fragment;
|
|
16985
16987
|
};
|
|
16986
|
-
|
|
16988
|
+
const finish = (tree, file) => {
|
|
16987
16989
|
const source = String(file);
|
|
16988
16990
|
const marked = source.charCodeAt(0) === 65279;
|
|
16989
16991
|
const text3 = marked ? source.slice(1) : source;
|
|
@@ -16991,6 +16993,28 @@ function remarkObsidian(userOpts) {
|
|
|
16991
16993
|
if (opts.callouts) calloutMarkerTransform(tree, text3);
|
|
16992
16994
|
if (marked && opts.bomOffsets) countByteOrderMark(tree);
|
|
16993
16995
|
};
|
|
16996
|
+
let finishing = false;
|
|
16997
|
+
const finished = /* @__PURE__ */ new WeakSet();
|
|
16998
|
+
const finishOnce = (tree, file) => {
|
|
16999
|
+
finishing = true;
|
|
17000
|
+
try {
|
|
17001
|
+
finish(tree, file);
|
|
17002
|
+
} finally {
|
|
17003
|
+
finishing = false;
|
|
17004
|
+
}
|
|
17005
|
+
finished.add(tree);
|
|
17006
|
+
};
|
|
17007
|
+
const parser = self.parser;
|
|
17008
|
+
if (parser) {
|
|
17009
|
+
self.parser = (document, file) => {
|
|
17010
|
+
const tree = parser(document, file);
|
|
17011
|
+
if (!finishing) finishOnce(tree, file);
|
|
17012
|
+
return tree;
|
|
17013
|
+
};
|
|
17014
|
+
}
|
|
17015
|
+
return (tree, file) => {
|
|
17016
|
+
if (!finished.has(tree)) finishOnce(tree, file);
|
|
17017
|
+
};
|
|
16994
17018
|
}
|
|
16995
17019
|
export {
|
|
16996
17020
|
COMMENT_ELEMENT,
|