cmark

Unnamed repository; edit this file 'description' to name the repository.

commit 25fbd4620934f99033b0fb27849d064516e1357d
parent e22f3b777dd53e587db6dba76e86bf3276ad619f
Author: John MacFarlane <jgm@berkeley.edu>
Date:   Sat, 22 Nov 2014 20:48:37 -0800

js html renderer:  formatting changes to align with changes in spec.

Diffstat:
Mjs/lib/html-renderer.js | 9++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/js/lib/html-renderer.js b/js/lib/html-renderer.js
@@ -88,7 +88,14 @@ var renderBlock = function(block, in_tight_list) {
         return inTags('blockquote', [], filling === '' ? this.innersep :
                       this.innersep + filling + this.innersep);
     case 'ListItem':
-        return inTags('li', [], this.renderBlocks(block.children, in_tight_list).trim());
+        var contents = this.renderBlocks(block.children, in_tight_list);
+        if (/^[<]/.test(contents)) {
+            contents = '\n' + contents;
+        }
+        if (/[>]$/.test(contents)) {
+            contents = contents + '\n';
+        }
+        return inTags('li', [], contents, false).trim();
     case 'List':
         tag = block.list_data.type == 'Bullet' ? 'ul' : 'ol';
         attr = (!block.list_data.start || block.list_data.start == 1) ?