summaryrefslogtreecommitdiff
path: root/js/lib
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-11-22 20:48:37 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2014-11-22 20:48:37 -0800
commit25fbd4620934f99033b0fb27849d064516e1357d (patch)
tree5805a18e5619de5abae0fb5c5981d25b5fa42d81 /js/lib
parente22f3b777dd53e587db6dba76e86bf3276ad619f (diff)
js html renderer: formatting changes to align with changes in spec.
Diffstat (limited to 'js/lib')
-rw-r--r--js/lib/html-renderer.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/js/lib/html-renderer.js b/js/lib/html-renderer.js
index 6eb96bc..e55b103 100644
--- 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) ?