Fix MFM strike parsing
This commit is contained in:
parent
af60b45ee7
commit
63c659bc8f
|
@ -104,7 +104,7 @@ export const mfmLanguage = P.createLanguage({
|
||||||
|
|
||||||
return P.alt(xml, underscore).map(x => createTree('italic', r.inline.atLeast(1).tryParse(x), {}));
|
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 => {
|
motion: r => {
|
||||||
const paren = P.regexp(/\(\(\(([\s\S]+?)\)\)\)/, 1);
|
const paren = P.regexp(/\(\(\(([\s\S]+?)\)\)\)/, 1);
|
||||||
const xml = P.regexp(/<motion>(.+?)<\/motion>/, 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', () => {
|
describe('italic', () => {
|
||||||
|
|
Loading…
Reference in New Issue