Comparing version 0.5.3 to 0.5.4
@@ -8,2 +8,3 @@ var _utils = require('../utils'); | ||
var defaultOptions = require('./options'); | ||
var isHTMLBlock = require('./html_blocks'); | ||
@@ -110,8 +111,10 @@ /** | ||
if (cap = this.rules.html.exec(src)) { | ||
// Found a paragraph | ||
if(cap[1] === 'p' && cap[2]) { | ||
// Found a link | ||
if(cap[1] === 'a' && cap[2] && !this.inLink) { | ||
// Opening tag | ||
out += cap[0].substring(0, cap[0].indexOf(cap[2])); | ||
this.inLink = true; | ||
// In between the tag | ||
out += this.output(cap[2]); | ||
this.inLink = false; | ||
// Outer tag | ||
@@ -124,10 +127,8 @@ out += cap[0].substring(cap[0].indexOf(cap[2])+cap[2].length); | ||
// Found a link | ||
if(cap[1] === 'a' && cap[2] && !this.inLink) { | ||
// Found HTML that we should parse | ||
if(!isHTMLBlock(cap[1]) && cap[2]) { | ||
// Opening tag | ||
out += cap[0].substring(0, cap[0].indexOf(cap[2])); | ||
this.inLink = true; | ||
// In between the tag | ||
out += this.output(cap[2]); | ||
this.inLink = false; | ||
// Outer tag | ||
@@ -139,3 +140,3 @@ out += cap[0].substring(cap[0].indexOf(cap[2])+cap[2].length); | ||
} | ||
// Any other HTML | ||
@@ -142,0 +143,0 @@ src = src.substring(cap[0].length); |
@@ -14,3 +14,3 @@ var _utils = require('../utils'); | ||
url: noop, | ||
html: /^<!--[\s\S]*?-->|^<(\w+(?!:\/|[^\w\s@]*@)\b)*?(?:"[^"]*"|'[^']*'|[^'">])*?>([\s\S]+)?<\/\1>|^<(\w+(?!:\/|[^\w\s@]*@)\b)(?:"[^"]*"|'[^']*'|[^'">])*?>/, | ||
html: /^<!--[\s\S]*?-->|^<(\w+(?!:\/|[^\w\s@]*@)\b)*?(?:"[^"]*"|'[^']*'|[^'">])*?>([\s\S]*?)?<\/\1>|^<(\w+(?!:\/|[^\w\s@]*@)\b)(?:"[^"]*"|'[^']*'|[^'">])*?>/, | ||
link: /^!?\[(inside)\]\(href\)/, | ||
@@ -17,0 +17,0 @@ reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/, |
@@ -5,3 +5,3 @@ { | ||
"author": "Aaron O'Mullan", | ||
"version": "0.5.3", | ||
"version": "0.5.4", | ||
"main": "./lib/kramed.js", | ||
@@ -8,0 +8,0 @@ "bin": "./bin/kramed", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
80927
28
1445