# HG changeset patch # User HIROSE Yuuji # Date 1656220254 -32400 # Node ID a094bd547d6bc7c8fa3f0f494468156bebbdd148 # Parent c69cf72ea116a546911948e96f47e28c37c0831e Escape chars in hover string diff -r c69cf72ea116 -r a094bd547d6b s4-main.js --- a/s4-main.js Sun Jun 26 13:51:03 2022 +0900 +++ b/s4-main.js Sun Jun 26 14:10:54 2022 +0900 @@ -14,6 +14,11 @@ mypath = mypath.substring(0, mypath.lastIndexOf("?")); //alert("mypath="+mypath); } + function escapeChars(old) { + return old.replaceAll('"', '"') + .replaceAll("<", '<') + .replaceAll(">", '>'); + } function collectElementsByAttr(elm, attr, val) { var e = document.getElementsByTagName(elm); if (!e) return null; @@ -1042,7 +1047,7 @@ authtd = repltd.parentNode.getElementsByTagName("td")[0], author = authtd.querySelector("a.author").innerText, digest = txt.split("\n").splice(0, hoverTextLines).join("\n"); - return "[[ "+author+" ]]\n"+digest; + return escapeChars("[[ "+author+" ]]\n"+digest); } else return ""; }