Skip to content

Commit

Permalink
Fix html stripping related to preview mode (tmcw#70)
Browse files Browse the repository at this point in the history
* Don't strip top level html

* Fix html stripping related to preview mode
  • Loading branch information
atomarch authored and tmcw committed Jan 28, 2018
1 parent 3f9a511 commit 4999028
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/components/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,8 @@ function chunkifyAST(ast, language) {
} else if (node.type === 'heading' && node.depth < 4 && !title) {
title = node.children[0].value;
left.push(node);
} else if (node.type === 'html') {
if (node.value.indexOf('<!--') === 0) {
var content = node.value
.replace(/^<!--/, '')
.replace(/-->$/, '')
.trim();
if (content === 'preview') {
preview = true;
}
}
} else if (node.type === 'html' && node.value.match(/^<!--\s*preview\s*-->$/)) {
preview = true;
} else {
left.push(node);
}
Expand Down

0 comments on commit 4999028

Please sign in to comment.