handle unescaped angle brackets in attribute. closes #12.
This commit is contained in:
parent
bb382e3425
commit
3296d10f18
@ -38,11 +38,7 @@ block.html = (function() {
|
||||
html = html
|
||||
.replace('comment', /<!--[^\0]*?-->/.source)
|
||||
.replace('closed', /<(\w+)[^\0]+?<\/\1>/.source)
|
||||
.replace('closing', /<\w+[^>]*>/.source);
|
||||
|
||||
// Better regexes:
|
||||
// .replace('closed', /<(\w+)\b[^\0]*?<\/\1>/.source)
|
||||
// .replace('closing', /<\w+(?!:\/|@)\b[^>]*>/.source);
|
||||
.replace('closing', /<\w+(?!:\/|@)\b(?:"[^"]*"|'[^']*'|[^>])*>/.source);
|
||||
|
||||
return new RegExp(html);
|
||||
})();
|
||||
@ -183,9 +179,6 @@ block.token = function(str, tokens, top) {
|
||||
|
||||
cap = cap[0].replace(/^ *>/gm, '');
|
||||
|
||||
// Better conformance:
|
||||
// cap = cap[0].replace(/^ *> ?/gm, '');
|
||||
|
||||
// Pass `top` to keep the current
|
||||
// "toplevel" state. This is exactly
|
||||
// how markdown.pl works.
|
||||
@ -293,7 +286,7 @@ var inline = {
|
||||
escape: /^\\([\\`*{}\[\]()#+\-.!_>])/,
|
||||
autolink: /^<([^ >]+(@|:\/)[^ >]+)>/,
|
||||
gfm_autolink: /^(\w+:\/\/[^\s]+[^.,:;"')\]\s])/,
|
||||
tag: /^<!--[^\0]*?-->|^<\/?\w+[^>]*>/,
|
||||
tag: /^<!--[^\0]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^>])*>/,
|
||||
link: /^!?\[((?:\[[^\]]*\]|[^\[\]]|\[|\](?=[^[\]]*\]))*)\]\(([^\)]*)\)/,
|
||||
reflink: /^!?\[((?:\[[^\]]*\]|[^\[\]]|\[|\](?=[^[\]]*\]))*)\]\s*\[([^\]]*)\]/,
|
||||
nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,
|
||||
|
@ -1 +1 @@
|
||||
<div style=">"></div>
|
||||
<div style=">"/>
|
||||
|
@ -1 +1 @@
|
||||
<div style=">"/></div>
|
||||
<div style=">"/>
|
||||
|
@ -1 +1 @@
|
||||
<div style=">"></div>
|
||||
<div style=">"/>
|
||||
|
@ -1 +1 @@
|
||||
<div style=">"/></div>
|
||||
<div style=">"/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user