Skip to content

Commit edc91dd

Browse files
authored
Merge pull request #57 from webdoc-js/fix/html-safe-data-type-links
Replace "<", ">" tokens in data type links with HTML safe counterparts.
2 parents a58f43b + 95a7fa9 commit edc91dd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/webdoc-template-library/src/template-plugins/LinkerPlugin.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,9 @@ function LinkerPluginShell() {
193193
return `<a href=${encodeURI(this.queryCache.get(docPath) || "")}>${linkText}</a>`;
194194
}
195195
if (isDataType(docPath)) {
196-
let link = docPath.template;
196+
let link = docPath.template
197+
.replace(/</g, "&lt;")
198+
.replace(/>/g, "&gt;");
197199

198200
for (let i = 1; i < docPath.length; i++) {
199201
link = link.replace(`%${i}`, this.linkTo(docPath[i], docPath[i], options));

0 commit comments

Comments
 (0)