From bd224466185ac8ec36d3a0b9749963f8bd57ea60 Mon Sep 17 00:00:00 2001 From: Muhammad Miziev Date: Sat, 12 Nov 2016 19:25:09 +0400 Subject: [PATCH 1/2] gruber: characters are lost Example: input: **** output: nothing Markdown should be valid only after enter text! Is not it? Now: input: **** output: **** --- src/dialects/gruber.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/dialects/gruber.js b/src/dialects/gruber.js index 0d37ec86..49a7b70b 100644 --- a/src/dialects/gruber.js +++ b/src/dialects/gruber.js @@ -737,7 +737,7 @@ define(['../markdown_helpers', './dialect_helpers', '../parser'], function (Mark // Always skip over the opening ticks. var m = text.match( /(`+)(([\s\S]*?)\1)/ ); - if ( m && m[2] ) + if ( m && m[2] && m[3].length > 0 ) return [ m[1].length + m[2].length, [ "inlinecode", m[3] ] ]; else { // TODO: No matching end code found - warn! @@ -785,7 +785,9 @@ define(['../markdown_helpers', './dialect_helpers', '../parser'], function (Mark // Recurse var res = this.processInline( text.substr( md.length ) ); //D:this.debug_indent = this.debug_indent.substr(2); - + + if(typeof(res[0]) != 'string') return; + var last = res[res.length - 1]; //D:this.debug("processInline from", tag + ": ", uneval( res ) ); From 78e39cd9fc2bee4310d9ce6cf983afe75b89aa31 Mon Sep 17 00:00:00 2001 From: Muhammad Miziev Date: Sat, 12 Nov 2016 19:46:15 +0400 Subject: [PATCH 2/2] upd --- src/dialects/gruber.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dialects/gruber.js b/src/dialects/gruber.js index 49a7b70b..8ba8b3b9 100644 --- a/src/dialects/gruber.js +++ b/src/dialects/gruber.js @@ -786,7 +786,7 @@ define(['../markdown_helpers', './dialect_helpers', '../parser'], function (Mark var res = this.processInline( text.substr( md.length ) ); //D:this.debug_indent = this.debug_indent.substr(2); - if(typeof(res[0]) != 'string') return; + if(typeof(res[0]) !== 'string') return; var last = res[res.length - 1];