summaryrefslogtreecommitdiff
path: root/js/lib/blocks.js
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-01-09 21:38:41 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2015-01-09 21:38:41 -0800
commit6f345edbcfbf2770ccdfb70c2a157eaf0e2930dd (patch)
tree8a1baca68d4286e93a62c0bc25c59bd8cf4ae465 /js/lib/blocks.js
parent054fea748f5b6aae9043925abf9b66991cd51887 (diff)
Improved newline parsing efficiency.
Don't check for `\n` when we know we have one. Gobble spaces after line break.
Diffstat (limited to 'js/lib/blocks.js')
-rw-r--r--js/lib/blocks.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/js/lib/blocks.js b/js/lib/blocks.js
index f948e8b..f965fd7 100644
--- a/js/lib/blocks.js
+++ b/js/lib/blocks.js
@@ -552,8 +552,7 @@ var finalize = function(block, line_number) {
switch (block.t) {
case 'Paragraph':
- block.string_content = block.strings.join('\n').replace(/^ {2,}/m, '');
- // delete block.strings;
+ block.string_content = block.strings.join('\n');
// try parsing the beginning as link reference definitions:
while (block.string_content.charCodeAt(0) === C_OPEN_BRACKET &&