mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-13 13:37:31 -07:00
Fix MFM strike parsing
This commit is contained in:
parent
57a7155cbb
commit
4c9b953d65
2 changed files with 9 additions and 1 deletions
|
@ -104,7 +104,7 @@ export const mfmLanguage = P.createLanguage({
|
|||
|
||||
return P.alt(xml, underscore).map(x => createTree('italic', r.inline.atLeast(1).tryParse(x), {}));
|
||||
},
|
||||
strike: r => P.regexp(/~~(.+?)~~/, 1).map(x => createTree('strike', r.inline.atLeast(1).tryParse(x), {})),
|
||||
strike: r => P.regexp(/~~([^\n~]+?)~~/, 1).map(x => createTree('strike', r.inline.atLeast(1).tryParse(x), {})),
|
||||
motion: r => {
|
||||
const paren = P.regexp(/\(\(\(([\s\S]+?)\)\)\)/, 1);
|
||||
const xml = P.regexp(/<motion>(.+?)<\/motion>/, 1);
|
||||
|
|
|
@ -1116,6 +1116,14 @@ describe('MFM', () => {
|
|||
], {}),
|
||||
]);
|
||||
});
|
||||
|
||||
// https://misskey.io/notes/7u1kv5dmia
|
||||
it('ignore internal tilde', () => {
|
||||
const tokens = parse('~~~~~');
|
||||
assert.deepStrictEqual(tokens, [
|
||||
text('~~~~~')
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('italic', () => {
|
||||
|
|
Loading…
Reference in a new issue