Support short-form markdown links [#54]
This commit is contained in:
parent
4d4b22aa91
commit
b74c806f24
|
@ -4235,6 +4235,13 @@
|
||||||
'text-decoration': 'underline',
|
'text-decoration': 'underline',
|
||||||
}),
|
}),
|
||||||
text: (m) => m[1].replace(CONTROL_CHARS$1, ''),
|
text: (m) => m[1].replace(CONTROL_CHARS$1, ''),
|
||||||
|
}, {
|
||||||
|
all: {matcher: /<([a-z]+:\/\/[^>]*)>/g, skip: 0},
|
||||||
|
attrs: (m) => ({
|
||||||
|
'href': m[1].replace(CONTROL_CHARS$1, ''),
|
||||||
|
'text-decoration': 'underline',
|
||||||
|
}),
|
||||||
|
text: (m) => m[1].replace(CONTROL_CHARS$1, ''),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -4235,6 +4235,13 @@
|
||||||
'text-decoration': 'underline',
|
'text-decoration': 'underline',
|
||||||
}),
|
}),
|
||||||
text: (m) => m[1].replace(CONTROL_CHARS$1, ''),
|
text: (m) => m[1].replace(CONTROL_CHARS$1, ''),
|
||||||
|
}, {
|
||||||
|
all: {matcher: /<([a-z]+:\/\/[^>]*)>/g, skip: 0},
|
||||||
|
attrs: (m) => ({
|
||||||
|
'href': m[1].replace(CONTROL_CHARS$1, ''),
|
||||||
|
'text-decoration': 'underline',
|
||||||
|
}),
|
||||||
|
text: (m) => m[1].replace(CONTROL_CHARS$1, ''),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -70,6 +70,13 @@ const STYLES = [
|
||||||
'text-decoration': 'underline',
|
'text-decoration': 'underline',
|
||||||
}),
|
}),
|
||||||
text: (m) => m[1].replace(CONTROL_CHARS, ''),
|
text: (m) => m[1].replace(CONTROL_CHARS, ''),
|
||||||
|
}, {
|
||||||
|
all: {matcher: /<([a-z]+:\/\/[^>]*)>/g, skip: 0},
|
||||||
|
attrs: (m) => ({
|
||||||
|
'href': m[1].replace(CONTROL_CHARS, ''),
|
||||||
|
'text-decoration': 'underline',
|
||||||
|
}),
|
||||||
|
text: (m) => m[1].replace(CONTROL_CHARS, ''),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -239,6 +239,19 @@ describe('Markdown Parser', () => {
|
||||||
]]);
|
]]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('recognises short link styling', () => {
|
||||||
|
const formatted = parser('a <http://b> c');
|
||||||
|
|
||||||
|
expect(formatted).toEqual([[
|
||||||
|
{attrs: null, text: 'a '},
|
||||||
|
{attrs: {
|
||||||
|
'href': 'http://b',
|
||||||
|
'text-decoration': 'underline',
|
||||||
|
}, text: 'http://b'},
|
||||||
|
{attrs: null, text: ' c'},
|
||||||
|
]]);
|
||||||
|
});
|
||||||
|
|
||||||
it('allows dots around monospace styling', () => {
|
it('allows dots around monospace styling', () => {
|
||||||
const formatted = parser('a.`b`.c');
|
const formatted = parser('a.`b`.c');
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue