Add new text syntax

And some fixes
This commit is contained in:
syuilo
2018-04-19 15:05:39 +09:00
parent f6a041559f
commit 7a270275ef
6 changed files with 56 additions and 2 deletions

View File

@ -54,6 +54,12 @@ const handlers = {
document.body.appendChild(blockquote);
},
title({ document }, { title }) {
const h1 = document.createElement('h1');
h1.textContent = title;
document.body.appendChild(h1);
},
text({ document }, { content }) {
for (const text of content.split('\n')) {
const node = document.createTextNode(text);