Emoji support in profile (#3514)

* Emoji in profile

* Add emojis to fields
This commit is contained in:
MeiMei
2018-12-06 10:02:04 +09:00
committed by syuilo
parent fe891da886
commit 4522568749
41 changed files with 261 additions and 70 deletions

View File

@@ -1,13 +1,13 @@
import parser, { Node } from './parser';
import parser, { Node, plainParser } from './parser';
import * as A from '../prelude/array';
import * as S from '../prelude/string';
export default (source: string): Node[] => {
export default (source: string, plainText = false): Node[] => {
if (source == null || source == '') {
return null;
}
let nodes: Node[] = parser.root.tryParse(source);
let nodes: Node[] = plainText ? plainParser.root.tryParse(source) : parser.root.tryParse(source);
const combineText = (es: Node[]): Node =>
({ name: 'text', props: { text: S.concat(es.map(e => e.props.text)) } });