aboutsummaryrefslogtreecommitdiff
path: root/js/lib/html-renderer.js
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-11-23 08:13:15 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2014-11-23 08:13:15 -0800
commit36d7aca943aef7a346f0529e0c54b74cb9710a5f (patch)
treef812ae6ae7b1171fc772fb6b6d999151e8f8eee7 /js/lib/html-renderer.js
parentf7f010070d59bd2bd9334ef1f5f18e6d1631f9cc (diff)
js: use 'CodeBlock' in AST for all code blocks.
Don't distinguish fenced, indented.
Diffstat (limited to 'js/lib/html-renderer.js')
-rw-r--r--js/lib/html-renderer.js12
1 files changed, 4 insertions, 8 deletions
diff --git a/js/lib/html-renderer.js b/js/lib/html-renderer.js
index faf5231..e4a5b3a 100644
--- a/js/lib/html-renderer.js
+++ b/js/lib/html-renderer.js
@@ -106,14 +106,10 @@ var renderBlock = function(block, in_tight_list) {
case 'Header':
tag = 'h' + block.level;
return inTags(tag, [], this.renderInlines(block.inline_content));
- case 'IndentedCode':
- return inTags('pre', [],
- inTags('code', [], this.escape(block.string_content)));
- case 'FencedCode':
- info_words = block.info.split(/ +/);
- attr = info_words.length === 0 || info_words[0].length === 0 ?
- [] : [['class','language-' +
- this.escape(info_words[0],true)]];
+ case 'CodeBlock':
+ info_words = block.info ? block.info.split(/ +/) : [];
+ attr = (info_words.length === 0 || info_words[0].length === 0) ?
+ [] : [['class','language-' + this.escape(info_words[0],true)]];
return inTags('pre', [],
inTags('code', attr, this.escape(block.string_content)));
case 'HtmlBlock':