Fix bug
This commit is contained in:
parent
5fb8f5a8c7
commit
10e5caa766
|
@ -92,6 +92,10 @@ const handlers: { [key: string]: (window: any, token: any, mentionedRemoteUsers:
|
||||||
};
|
};
|
||||||
|
|
||||||
export default (tokens: TextElement[], mentionedRemoteUsers: INote['mentionedRemoteUsers'] = []) => {
|
export default (tokens: TextElement[], mentionedRemoteUsers: INote['mentionedRemoteUsers'] = []) => {
|
||||||
|
if (tokens == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const { window } = new JSDOM('');
|
const { window } = new JSDOM('');
|
||||||
|
|
||||||
for (const token of tokens) {
|
for (const token of tokens) {
|
||||||
|
|
|
@ -43,8 +43,7 @@ export type TextElement = { type: 'text', content: string }
|
||||||
export type TextElementProcessor = (text: string, i: number) => TextElement | TextElement[];
|
export type TextElementProcessor = (text: string, i: number) => TextElement | TextElement[];
|
||||||
|
|
||||||
export default (source: string): TextElement[] => {
|
export default (source: string): TextElement[] => {
|
||||||
|
if (source == null || source == '') {
|
||||||
if (source == '') {
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue