1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-16 10:29:54 +00:00

Prevent HTML parser from mis-recognising email addresses

Email addresses such as `<jeremy@example.com>` were being erroneously
parsed as HTML tags.

Fixes #2604
This commit is contained in:
Jermolene 2016-10-12 13:17:53 +01:00
parent 989cee5059
commit f97c1226aa

View File

@ -101,6 +101,11 @@ exports.parseTag = function(source,pos,options) {
node.type = node.tag.substr(1);
}
pos = token.end;
// Check that the tag is terminated by a space, / or >
if(!$tw.utils.parseWhiteSpace(source,pos) && !(source.charAt(pos) === "/") && !(source.charAt(pos) === ">") ) {
console.log("Aborting illegal element tag")
return null;
}
// Process attributes
var attribute = $tw.utils.parseAttribute(source,pos);
while(attribute) {