Escape inner filelink text when normalizing filelink
MODIFY
packages/@romefrontend/cli-layout/format.ts
packages/@romefrontend/cli-layout/format.ts
@@ -34,6 +34,7 @@ function buildTag(
attributes = attributes.copy();
const {filename, line, column, text} = buildFileLink(attributes, opts);
+ inner = escapeMarkup(text);
attributes.get("column").setValue(column);
attributes.get("line").setValue(line);
attributes.get("target").setValue(filename);
@@ -41,7 +42,6 @@ function buildTag(
attributes.get("line").setValue(undefined);
attributes.get("column").setValue(undefined);
}
- inner = text;
break;
}

MODIFY
packages/@romefrontend/path/index.ts
packages/@romefrontend/path/index.ts
@@ -69,12 +69,7 @@ class BaseFilePath<Super extends UnknownFilePath> {
}
toMarkup(): string {
- let target = escapeMarkup(this.join());
- // Remove trailing slash if present as an explicit folder
- if (target[target.length - 1] === "/") {
- target = target.slice(0, -1);
- }
- return `<filelink target="${target}" />`;
+ return `<filelink target="${escapeMarkup(this.join())}" />`;
}
getParsed(): ParsedPath {

Escape inner filelink text when normalizing filelink