diff --git a/Parser.js b/Parser.js index 4a4a261..7c9b016 100644 --- a/Parser.js +++ b/Parser.js @@ -1,4 +1,4 @@ -// Generated by CoffeeScript 1.12.1 +// Generated by CoffeeScript 1.12.2 (function() { var Parser, slice = [].slice; @@ -248,6 +248,13 @@ } }; })(this)); + text = text.replace(//ig, (function(_this) { + return function() { + var matches; + matches = 1 <= arguments.length ? slice.call(arguments, 0) : []; + return _this.makeHolder(matches[0]); + }; + })(this)); text = str_replace(['<', '>'], ['<', '>'], text); text = text.replace(/\[\^((?:[^\]]|\\\]|\\\[)+?)\]/g, (function(_this) { return function() { diff --git a/cli.js b/cli.js index 47a95e0..65b841c 100644 --- a/cli.js +++ b/cli.js @@ -1,4 +1,4 @@ -// Generated by CoffeeScript 1.12.1 +// Generated by CoffeeScript 1.12.2 (function() { var Fs, Parser, buff, file, parser, read; diff --git a/src/Parser.coffee b/src/Parser.coffee index 6be3b42..6d7b59f 100644 --- a/src/Parser.coffee +++ b/src/Parser.coffee @@ -162,7 +162,6 @@ class Parser # release holder releaseHolder: (text, clearHolders = yes) -> deep = 0 - while (text.indexOf "\r") >= 0 and deep < 10 text = str_replace (array_keys @holders), (array_values @holders), text deep += 1 @@ -199,6 +198,10 @@ class Parser else htmlspecialchars matches[0] + # comment + text = text.replace //ig, (matches...) => + @makeHolder matches[0] + text = str_replace ['<', '>'], ['<', '>'], text # footnote @@ -251,7 +254,6 @@ class Parser text = @call 'afterParseInlineBeforeRelease', text text = @releaseHolder text, clearHolders - text = @call 'afterParseInline', text text