[MFM] Add center syntax

Resolve #1775
This commit is contained in:
syuilo
2018-11-25 13:36:40 +09:00
parent 2c5162671c
commit f3155ea180
5 changed files with 44 additions and 1 deletions

View File

@@ -45,6 +45,12 @@ export default (tokens: Node[], mentionedRemoteUsers: INote['mentionedRemoteUser
return pre;
},
center(token) {
const el = doc.createElement('div');
dive(token.children).forEach(child => el.appendChild(child));
return el;
},
emoji(token) {
return doc.createTextNode(token.props.emoji ? token.props.emoji : `:${token.props.name}:`);
},