aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/lib/blocks.js5
-rw-r--r--js/lib/html-renderer.js12
2 files changed, 7 insertions, 10 deletions
diff --git a/js/lib/blocks.js b/js/lib/blocks.js
index cd42090..53fe2b9 100644
--- a/js/lib/blocks.js
+++ b/js/lib/blocks.js
@@ -566,6 +566,7 @@ var finalize = function(block, line_number) {
case 'IndentedCode':
block.string_content = block.strings.join('\n').replace(/(\n *)*$/,'\n');
+ block.t = 'CodeBlock';
break;
case 'FencedCode':
@@ -576,6 +577,7 @@ var finalize = function(block, line_number) {
} else {
block.string_content = block.strings.slice(1).join('\n') + '\n';
}
+ block.t = 'CodeBlock';
break;
case 'List':
@@ -638,11 +640,10 @@ var processInlines = function(block) {
newblock.list_data = block.list_data;
newblock.tight = block.tight;
break;
- case 'FencedCode':
+ case 'CodeBlock':
newblock.string_content = block.string_content;
newblock.info = block.info;
break;
- case 'IndentedCode':
case 'HtmlBlock':
newblock.string_content = block.string_content;
break;
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':