Fix MFM parsing: Ignore parent [] of URL
This commit is contained in:
parent
10677b57d4
commit
76693138d3
2 changed files with 11 additions and 2 deletions
|
@ -6,8 +6,8 @@ import { toUnicode } from 'punycode';
|
|||
import { emojiRegex } from '../misc/emoji-regex';
|
||||
|
||||
export function removeOrphanedBrackets(s: string): string {
|
||||
const openBrackets = ['(', '「'];
|
||||
const closeBrackets = [')', '」'];
|
||||
const openBrackets = ['(', '「', '['];
|
||||
const closeBrackets = [')', '」', ']'];
|
||||
const xs = cumulativeSum(s.split('').map(c => {
|
||||
if (openBrackets.includes(c)) return 1;
|
||||
if (closeBrackets.includes(c)) return -1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue