Fix html stripping related to preview mode (#70)
* Don't strip top level html * Fix html stripping related to preview mode
This commit is contained in:
committed by
Tom MacWright
parent
3f9a511f9a
commit
4999028cac
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user