mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-22 23:16:53 +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:
parent
989cee5059
commit
f97c1226aa
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user