mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-26 11:57:34 -07:00
Fix MFM parsing
This commit is contained in:
parent
00fb96b306
commit
4cdf5f82a1
2 changed files with 7 additions and 1 deletions
|
@ -17,7 +17,8 @@ export default function(text: string, index: number) {
|
||||||
const quote = match[1]
|
const quote = match[1]
|
||||||
.split('\n')
|
.split('\n')
|
||||||
.map(line => line.replace(/^>+/g, '').trim())
|
.map(line => line.replace(/^>+/g, '').trim())
|
||||||
.join('\n');
|
.join('\n')
|
||||||
|
.trim();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
type: 'quote',
|
type: 'quote',
|
||||||
|
|
|
@ -152,6 +152,11 @@ describe('Text', () => {
|
||||||
assert.deepEqual([
|
assert.deepEqual([
|
||||||
{ type: 'quote', content: '> foo\n> bar\n> baz', quote: 'foo\nbar\nbaz' }
|
{ type: 'quote', content: '> foo\n> bar\n> baz', quote: 'foo\nbar\nbaz' }
|
||||||
], tokens4);
|
], tokens4);
|
||||||
|
|
||||||
|
const tokens5 = analyze('"\nfoo\nbar\nbaz\n"');
|
||||||
|
assert.deepEqual([
|
||||||
|
{ type: 'quote', content: '"\nfoo\nbar\nbaz\n"', quote: 'foo\nbar\nbaz' }
|
||||||
|
], tokens5);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('url', () => {
|
it('url', () => {
|
||||||
|
|
Loading…
Reference in a new issue