fix(app): exclude sentence punctuation from bare Markdown links (#7361)
The shared MD4C permissive autolink scanner consumed trailing path periods and rejected colon boundaries. Fix recognition in the dependency patch and rebuild its web parser so native and web agree. Preserve balanced path parentheses and explicit destinations.
This commit is contained in:
1 parent
b50acc9344
commit
66348a5e5c
2 files changed
+285
-45
No files matched your search
@@ -208,6 +208,56 @@ it("lets the engine own code boundaries while classifying candidate values", asy
|
||||
]);
|
||||
});
|
||||
|
||||
describe("bare URL sentence punctuation", () => {
|
||||
it.each([".", ",", ";", ":", "!", "?", ")", ").", "...", "?!"])(
|
||||
"leaves %s outside the link and preserves the rendered sentence",
|
||||
async (punctuation) => {
|
||||
const url = "https://github.com/getpaseo/paseo/pull/7357";
|
||||
const source = `${url}${punctuation} Not merged.`;
|
||||
const prepared = prepareMarkdownSource(source);
|
||||
const tree = recognizeTextLinks(
|
||||
await parseMarkdown(prepared.render(), { latexMath: false }),
|
||||
prepared.linkRecognition.text,
|
||||
prepared.linkRecognition.inlineCode,
|
||||
);
|
||||
expect(tree.children?.[0]?.children).toEqual([
|
||||
{
|
||||
type: "Link",
|
||||
attributes: { url },
|
||||
children: [{ type: "Text", content: url }],
|
||||
},
|
||||
{ type: "Text", content: `${punctuation} Not merged.` },
|
||||
]);
|
||||
},
|
||||
);
|
||||
|
||||
it.each([
|
||||
"https://example.com/a.b",
|
||||
"https://example.com/a?foo=bar&baz=2",
|
||||
"https://example.com/a#L10",
|
||||
"https://en.wikipedia.org/wiki/Function_(mathematics)",
|
||||
"https://example.com/a_(b_(c))",
|
||||
])("preserves internal URL punctuation: %s", async (url) => {
|
||||
const tree = await parseMarkdown(prepareMarkdownSource(`${url}.`).render());
|
||||
expect(tree.children?.[0]?.children).toEqual([
|
||||
{
|
||||
type: "Link",
|
||||
attributes: { url },
|
||||
children: [{ type: "Text", content: url }],
|
||||
},
|
||||
{ type: "Text", content: "." },
|
||||
]);
|
||||
});
|
||||
|
||||
it.each(["[Authored](https://example.com/a.)", "<https://example.com/a.>"])(
|
||||
"preserves punctuation in explicit destinations: %s",
|
||||
async (source) => {
|
||||
const tree = await parseMarkdown(prepareMarkdownSource(source).render());
|
||||
expect(tree.children?.[0]?.children?.[0]?.attributes?.url).toBe("https://example.com/a.");
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it("requires workspace context for relative inline paths and escapes literal regex characters", () => {
|
||||
const source = "`src/app/[id].tsx` and `src/a+b.ts` and `README.md` and `/tmp/file.ts`";
|
||||
const withoutWorkspace = prepareMarkdownSource(source).linkRecognition.inlineCode;
|
||||
|
||||
@@ -652,6 +652,37 @@ index fde4b04..b524ea7 100644
|
||||
}
|
||||
|
||||
fun View.emitImagePressEvent(
|
||||
diff --git a/node_modules/react-native-enriched-markdown/cpp/md4c/md4c.c b/node_modules/react-native-enriched-markdown/cpp/md4c/md4c.c
|
||||
index 44d5134a4..feef5eec8 100644
|
||||
--- a/node_modules/react-native-enriched-markdown/cpp/md4c/md4c.c
|
||||
+++ b/node_modules/react-native-enriched-markdown/cpp/md4c/md4c.c
|
||||
@@ -4551,7 +4551,7 @@ md_analyze_permissive_autolink(MD_CTX* ctx, int mark_index)
|
||||
/* Scan for path segment. */
|
||||
if(end < line_end && CH(end) == _T('/')) {
|
||||
if(md_analyze_permissive_autolink_segment(ctx, end+1, line_end, &end, false,
|
||||
- _T('/'), _T(".+-_~%"), NULL, &right_cursor) < 0)
|
||||
+ _T('/'), _T(".+-_~%()"), NULL, &right_cursor) < 0)
|
||||
return;
|
||||
|
||||
/* Path can also end with additional '/' if its a directory. */
|
||||
@@ -4574,9 +4574,16 @@ md_analyze_permissive_autolink(MD_CTX* ctx, int mark_index)
|
||||
}
|
||||
}
|
||||
|
||||
+ /* Sentence punctuation is not part of a permissive autolink. Trim only
|
||||
+ * the final suffix, so dots inside paths and queries remain intact.
|
||||
+ * Explicit Markdown destinations and angle-bracket autolinks do not use
|
||||
+ * this analyzer and retain their authored punctuation. */
|
||||
+ while(end > beg && ISANYOF(end-1, _T(".,;:!?")))
|
||||
+ end--;
|
||||
+
|
||||
/* Verify there's line boundary, whitespace, allowed punctuation or
|
||||
* resolved closer mark just after the suspected autolink. */
|
||||
- if(end < line_end && !ISUNICODEWHITESPACE(end) && !ISANYOF(end, _T(")}].!?,;"))) {
|
||||
+ if(end < line_end && !ISUNICODEWHITESPACE(end) && !ISANYOF(end, _T(")}].!?,;:"))) {
|
||||
MD_MARK* mark;
|
||||
|
||||
mark = md_scan_right_for_resolved_mark(ctx, right_cursor, end, &right_cursor);
|
||||
diff --git a/node_modules/react-native-enriched-markdown/cpp/parser/MD4CParser.cpp b/node_modules/react-native-enriched-markdown/cpp/parser/MD4CParser.cpp
|
||||
index c99a52d..c93aaf7 100644
|
||||
--- a/node_modules/react-native-enriched-markdown/cpp/parser/MD4CParser.cpp
|
||||
@@ -1379,12 +1410,15 @@ index 049421a..c05b993 100644
|
||||
-{"version":3,"names":["useState","useEffect","extractNodeText","listItemStyle","checkedTaskTextStyle","jsx","_jsx","jsxs","_jsxs","NESTED_LIST_TYPES","Set","ListRenderer","node","styles","parentType","renderChildren","listTag","ListTag","isNested","hasTaskChild","children","some","child","attributes","isTask","resolvedStyle","listNested","listTask","list","style","UnorderedListRenderer","props","OrderedListRenderer","isNestedList","has","type","ListItemRenderer","index","callbacks","capabilities","initialChecked","taskChecked","taskText","isChecked","setIsChecked","handleChange","enableTaskListItemToggle","taskIndex","undefined","newChecked","onTaskListItemPress","checked","text","hasNestedList","checkedStyle","inlineNode","filter","nestedNode","onChange","readOnly","taskCheckbox","taskCheckboxDisabled","listRenderers","UnorderedList","OrderedList","ListItem"],"sourceRoot":"../../../../src","sources":["web/renderers/ListRenderers.tsx"],"mappings":";;AAAA,SAASA,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAC3C,SAASC,eAAe,QAAQ,aAAU;AAE1C,SAASC,aAAa,EAAEC,oBAAoB,QAAQ,cAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEhE,MAAM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AC1D,IAAI;EAER,oBACEzB,KAAA;IAAIqB,KAAK,EAAE1B,aAAa,CAAC0B,KAAK,EAAEL,MAAM,EAAE,CAACa,KAAK,IAAI,CAAC,MAAM,CAAC,CAAE;IAAAjB,QAAA,gBAC1DZ,KAAA;MAAMqB,KAAK,EAAEyB,YAAa;MAAAlC,QAAA,GACvBI,MAAM,iBACLlB,IAAA;QACE6B,IAAI,EAAC,UAAU;QACfgB,OAAO,EAAER,SAAU;QACnBe,QAAQ,EAAEb,YAAa;QACvBc,QAAQ,EAAE,CAACpB,YAAY,CAACO,wBAAyB;QACjD,iBACEP,YAAY,CAACO,wBAAwB,GAAGE,SAAS,GAAG,IACrD;QACDnB,KAAK,EACHU,YAAY,CAACO,wBAAwB,GACjCjC,MAAM,CAAC+C,YAAY,GACnB/C,MAAM,CAACgD,oBACZ;QACD,cAAY,SAASnB,QAAQ;MAAG,CACjC,CACF,EACA3B,cAAc,CAACwC,UAAU,CAAC;IAAA,CACvB,CAAC,EACNE,UAAU,IAAI1C,cAAc,CAAC0C,UAAU,CAAC;EAAA,CACvC,CAAC;AAET;AAEA,OAAO,MAAMK,aAA0B,GAAG;EACxCC,aAAa,EAAEjC,qBAAqB;EACpCkC,WAAW,EAAEhC,mBAAmB;EAChCiC,QAAQ,EAAE7B;AACZ,CAAC","ignoreList":[]}
|
||||
+{"version":3,"names":["useState","useEffect","extractNodeText","listItemStyle","checkedTaskTextStyle","jsx","_jsx","jsxs","_jsxs","NESTED_LIST_TYPES","Set","ListRenderer","node","styles","parentType","renderChildren","listTag","ListTag","isNested","hasTaskChild","children","some","child","attributes","isTask","resolvedStyle","listNested","listTask","list","start","Number","undefined","style","UnorderedListRenderer","props","OrderedListRenderer","isNestedList","has","type","ListItemRenderer","index","callbacks","capabilities","initialChecked","taskChecked","taskText","isChecked","setIsChecked","handleChange","enableTaskListItemToggle","taskIndex","newChecked","onTaskListItemPress","checked","text","hasNestedList","checkedStyle","inlineNode","filter","nestedNode","onChange","readOnly","taskCheckbox","taskCheckboxDisabled","listRenderers","UnorderedList","OrderedList","ListItem"],"sourceRoot":"../../../../src","sources":["web/renderers/ListRenderers.tsx"],"mappings":";;AAAA,SAASA,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAC3C,SAASC,eAAe,QAAQ,aAAU;AAE1C,SAASC,aAAa,EAAEC,oBAAoB,QAAQ,cAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEhE,MAAMC,iBAAgC,GAAG,IAAIC,GAAG,CAAC,CAC/C,eAAe,EACf,aAAa,CACd,CAAC;AAEF,SAASC,YAAYA,CAAC;EACpBC,IAAI;EACJC,MAAM;EACNC,UAAU;EACVC,cAAc;EACdC,OAAO,EAAEC;AAC+B,CAAC,EAAE;EAC3C,MAAMC,QAAQ,GAAGJ,UAAU,KAAK,UAAU;EAC1C,MAAMK,YAAY,GAChB,CAACD,QAAQ,IACTN,IAAI,CAACQ,QAAQ,EAAEC,IAAI,CAAEC,KAAK,IAAKA,KAAK,CAACC,UAAU,EAAEC,MAAM,KAAK,MAAM,CAAC;EAErE,MAAMC,aAAa,GAAGP,QAAQ,GAC1BL,MAAM,CAACa,UAAU,GACjBP,YAAY,GACVN,MAAM,CAACc,QAAQ,GACfd,MAAM,CAACe,IAAI;EACjB,oBACEtB,IAAA,CAACW,OAAO;IACNY,KAAK,EAAEZ,OAAO,KAAK,IAAI,GAAGa,MAAM,CAAClB,IAAI,CAACW,UAAU,EAAEM,KAAK,IAAI,CAAC,CAAC,GAAGE,SAAU;IAC1EC,KAAK,EAAEP,aAAc;IAAAL,QAAA,EAEpBL,cAAc,CAACH,IAAI;EAAC,CACd,CAAC;AAEd;AAEA,SAASqB,qBAAqBA,CAACC,KAAoB,EAAE;EACnD,oBAAO5B,IAAA,CAACK,YAAY;IAAA,GAAKuB,KAAK;IAAElB,OAAO,EAAC;EAAI,CAAE,CAAC;AACjD;AAEA,SAASmB,mBAAmBA,CAACD,KAAoB,EAAE;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ACZ,CAAC","ignoreList":[]}
|
||||
diff --git a/node_modules/react-native-enriched-markdown/lib/module/web/wasm/md4c.js b/node_modules/react-native-enriched-markdown/lib/module/web/wasm/md4c.js
|
||||
index 978a8c7..950cccd 100644
|
||||
index 978a8c761..25e525d91 100644
|
||||
--- a/node_modules/react-native-enriched-markdown/lib/module/web/wasm/md4c.js
|
||||
+++ b/node_modules/react-native-enriched-markdown/lib/module/web/wasm/md4c.js
|
||||
@@ -3,10 +3,11 @@
|
||||
@@ -1,15 +1,16 @@
|
||||
"use strict";
|
||||
|
||||
var createMd4cModule = (() => {
|
||||
var _scriptName = globalThis.document?.currentScript?.src;
|
||||
- var _scriptName = globalThis.document?.currentScript?.src;
|
||||
+ var _scriptName = typeof document != 'undefined' ? document.currentScript?.src : undefined;
|
||||
return async function (moduleArg = {}) {
|
||||
+ var moduleRtn;
|
||||
var Module = moduleArg;
|
||||
@@ -1394,21 +1428,26 @@ index 978a8c7..950cccd 100644
|
||||
+ var arguments_ = [];
|
||||
var thisProgram = "./this.program";
|
||||
var scriptDirectory = "";
|
||||
var readAsync;
|
||||
@@ -30,8 +31,6 @@ var createMd4cModule = (() => {
|
||||
- var readAsync;
|
||||
+ var readAsync, readBinary;
|
||||
if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {
|
||||
try {
|
||||
scriptDirectory = new URL(".", _scriptName).href;
|
||||
@@ -30,22 +31,13 @@ var createMd4cModule = (() => {
|
||||
var err = console.error.bind(console);
|
||||
var wasmBinary;
|
||||
var ABORT = false;
|
||||
- class EmscriptenEH {}
|
||||
- class EmscriptenSjLj extends EmscriptenEH {}
|
||||
function binaryDecode(bin) {
|
||||
for (var i = 0, l = bin.length, o = new Uint8Array(l), c; i < l; ++i) {
|
||||
c = bin.charCodeAt(i);
|
||||
@@ -39,13 +38,12 @@ var createMd4cModule = (() => {
|
||||
}
|
||||
return o;
|
||||
}
|
||||
- function binaryDecode(bin) {
|
||||
- for (var i = 0, l = bin.length, o = new Uint8Array(l), c; i < l; ++i) {
|
||||
- c = bin.charCodeAt(i);
|
||||
- o[i] = ~c >> 8 & c;
|
||||
- }
|
||||
- return o;
|
||||
- }
|
||||
+ var readyPromiseResolve, readyPromiseReject;
|
||||
+ var wasmMemory;
|
||||
+ var HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64;
|
||||
+ var HEAP64, HEAPU64;
|
||||
var runtimeInitialized = false;
|
||||
@@ -1422,7 +1461,7 @@ index 978a8c7..950cccd 100644
|
||||
HEAP8 = new Int8Array(b);
|
||||
HEAP16 = new Int16Array(b);
|
||||
HEAPU8 = new Uint8Array(b);
|
||||
@@ -58,10 +56,11 @@ var createMd4cModule = (() => {
|
||||
@@ -58,10 +50,11 @@ var createMd4cModule = (() => {
|
||||
HEAPU64 = new BigUint64Array(b);
|
||||
}
|
||||
function preRun() {
|
||||
@@ -1438,7 +1477,7 @@ index 978a8c7..950cccd 100644
|
||||
}
|
||||
callRuntimeCallbacks(onPreRuns);
|
||||
}
|
||||
@@ -70,25 +69,27 @@ var createMd4cModule = (() => {
|
||||
@@ -70,28 +63,56 @@ var createMd4cModule = (() => {
|
||||
wasmExports["__wasm_call_ctors"]();
|
||||
}
|
||||
function postRun() {
|
||||
@@ -1454,6 +1493,23 @@ index 978a8c7..950cccd 100644
|
||||
}
|
||||
callRuntimeCallbacks(onPostRuns);
|
||||
}
|
||||
+ var runDependencies = 0;
|
||||
+ var dependenciesFulfilled = null;
|
||||
+ function addRunDependency(id) {
|
||||
+ runDependencies++;
|
||||
+ Module["monitorRunDependencies"]?.(runDependencies);
|
||||
+ }
|
||||
+ function removeRunDependency(id) {
|
||||
+ runDependencies--;
|
||||
+ Module["monitorRunDependencies"]?.(runDependencies);
|
||||
+ if (runDependencies == 0) {
|
||||
+ if (dependenciesFulfilled) {
|
||||
+ var callback = dependenciesFulfilled;
|
||||
+ dependenciesFulfilled = null;
|
||||
+ callback();
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
function abort(what) {
|
||||
Module["onAbort"]?.(what);
|
||||
- what = `Aborted(${what})`;
|
||||
@@ -1468,20 +1524,47 @@ index 978a8c7..950cccd 100644
|
||||
var wasmBinaryFile;
|
||||
function findWasmBinary() {
|
||||
- return binaryDecode(' | ||||