From 3fa482a86811842339744415da5bd939c4b1642b Mon Sep 17 00:00:00 2001 From: Steve Fenton Date: Fri, 5 Sep 2014 16:53:38 +0100 Subject: Minor fixes - non messed-up version! A few undeclared variables - no big deal there. One use of block_end_line where block.end_line was meant (I believe). Also - query as to whether the new keyword is needed when calling InlineParser as the function returns an object, so we're not dealing with an instance of InlineParser (I haven't changed this, just a query). --- js/stmd.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'js') diff --git a/js/stmd.js b/js/stmd.js index 16baa59..76edf51 100755 --- a/js/stmd.js +++ b/js/stmd.js @@ -4,7 +4,7 @@ // Basic usage: // -// var stmd = require('stmd'); +// var stmd = require('stmd');ret // var parser = new stmd.DocParser(); // var renderer = new stmd.HtmlRenderer(); // console.log(renderer.render(parser.parse('Hello *world*'))); @@ -373,7 +373,7 @@ var parseEmphasis = function(inlines) { return (this.pos - startpos); default: - return result; + return res; } return 0; @@ -382,7 +382,7 @@ var parseEmphasis = function(inlines) { // Attempt to parse link title (sans quotes), returning the string // or null if no match. var parseLinkTitle = function() { - title = this.match(reLinkTitle); + var title = this.match(reLinkTitle); if (title) { // chop off quotes from title and unescape: return unescape(title.substr(1, title.length - 2)); @@ -861,7 +861,7 @@ var parseListMarker = function(ln, offset) { } else { return null; } - blank_item = match[0].length === rest.length; + var blank_item = match[0].length === rest.length; if (spaces_after_marker >= 5 || spaces_after_marker < 1 || blank_item) { @@ -926,7 +926,7 @@ var incorporateLine = function(ln, line_number) { switch (container.t) { case 'BlockQuote': - matched = indent <= 3 && ln[first_nonspace] === '>'; + var matched = indent <= 3 && ln[first_nonspace] === '>'; if (matched) { offset = first_nonspace + 1; if (ln[offset] === ' ') { @@ -1234,7 +1234,7 @@ var finalize = function(block, line_number) { if (line_number > block.start_line) { block.end_line = line_number - 1; } else { - block_end_line = line_number; + block.end_line = line_number; } switch (block.t) { -- cgit v1.2.3 From 1bc5557108d6297350dcffae2df50c532d023396 Mon Sep 17 00:00:00 2001 From: Steve Fenton Date: Fri, 5 Sep 2014 16:57:36 +0100 Subject: Update stmd.js --- js/stmd.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js') diff --git a/js/stmd.js b/js/stmd.js index 76edf51..65b958d 100755 --- a/js/stmd.js +++ b/js/stmd.js @@ -4,7 +4,7 @@ // Basic usage: // -// var stmd = require('stmd');ret +// var stmd = require('stmd'); // var parser = new stmd.DocParser(); // var renderer = new stmd.HtmlRenderer(); // console.log(renderer.render(parser.parse('Hello *world*'))); -- cgit v1.2.3