tent-markdown
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -33,2 +33,7 @@ // Released under BSD license | ||
if ( (_m = block.match(/\[[^\]]+\]\([^\)]+\)$/)) && (_m.index < item.indices[0]) && (_m.index + _m[0].length > item.indices[0]) ) { | ||
// markdown link syntax, don't autolink | ||
continue; | ||
} | ||
if ( block.slice(item.indices[0] - 1, block.length).match(/^\[[^\]]+\]\([^\)]+\)/) ) { | ||
@@ -53,3 +58,3 @@ // url inside markdown link display text, don't autolink | ||
for (var j = 0; j < _indices.length; j += 2) { | ||
if ( (_indices[j] < item.indices[0]) && (_indices[j+1] > item.indices[1]) ) { | ||
if ( (_indices[j] < item.indices[0]) && (_indices[j+1] >= item.indices[1]) ) { | ||
// matched url is inside code backticks, ignore | ||
@@ -228,7 +233,7 @@ _last_index = _indices[j+1]; | ||
"~": function italic( text ) { | ||
// Inline content is possible inside `bold text` | ||
"~": function strikethrough( text ) { | ||
// Inline content is possible inside `deleted text` | ||
var res = Markdown.DialectHelpers.inline_until_char.call( this, text.substr(1), "~" ); | ||
// Not bold | ||
// Not deleted text | ||
if ( !res ) return [ 1, "~" ]; | ||
@@ -239,2 +244,5 @@ | ||
// Ignore since there is whitespace before the closing `~` | ||
var last_child = children[ children.length-1 ]; | ||
if ( typeof last_child === 'string' && last_child.substr(last_child.length - 2).match(/[\s\r\n]/) ) return [ 1, "~"]; | ||
@@ -241,0 +249,0 @@ return [consumed, ["del"].concat(children)] |
{ | ||
"name": "tent-markdown", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Tent dialect for markdown lib", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -66,3 +66,4 @@ // Adapted from https://github.com/evilstreak/markdown-js/blob/95f77476731793a2831184b2ebb935ce846b4bad/test/features.t.js | ||
"links", | ||
"links/autolink" | ||
"links/autolink", | ||
"strikethrough" | ||
]; | ||
@@ -69,0 +70,0 @@ |
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
60322
55
1547