Scope & rewrite in links to what is actually contained in the href

This commit is contained in:
Morgan McMillian 2020-02-05 22:00:52 -08:00
parent c1bbb23daf
commit 14e536947b

View file

@ -20,6 +20,11 @@
function fixPostHtml(data) { function fixPostHtml(data) {
data = data.replace(/<\\?\/?span[^>]*>/g, ""); data = data.replace(/<\\?\/?span[^>]*>/g, "");
data = data.replace(/<br>/g, "<br/>"); data = data.replace(/<br>/g, "<br/>");
data = data.replace(/&/g, "&amp;"); var hrefreg = /<a\shref=\\?"([^>]*)\\?">/;
var hrefm = hrefreg.exec(data);
if (hrefm != null) {
var href = hrefm[1].replace(/&/g, "&amp;");
data = data.replace(hrefreg, "<a href=\"" + href + "\">");
}
return data; return data;
} }