fix(markdown): do not collapse multiple newlines
This commit is contained in:
parent
b3a4e5d0f4
commit
dd87587708
2 changed files with 7 additions and 1 deletions
|
@ -385,7 +385,7 @@ function parse(
|
||||||
result += '\n'
|
result += '\n'
|
||||||
}
|
}
|
||||||
|
|
||||||
const nonWhitespace = text.slice(pos + 1).search(/\S/)
|
const nonWhitespace = text.slice(pos + 1).search(/[^ \t]/)
|
||||||
|
|
||||||
if (nonWhitespace !== -1) {
|
if (nonWhitespace !== -1) {
|
||||||
pos += nonWhitespace + 1
|
pos += nonWhitespace + 1
|
||||||
|
|
|
@ -533,6 +533,12 @@ describe('MarkdownMessageEntityParser', () => {
|
||||||
[createEntity('messageEntityBold', 10, 4)],
|
[createEntity('messageEntityBold', 10, 4)],
|
||||||
'some text\nbold\nmore text',
|
'some text\nbold\nmore text',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
test(
|
||||||
|
md_`text\n\n\nmore text`,
|
||||||
|
[],
|
||||||
|
'text\n\n\nmore text',
|
||||||
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should process entities', () => {
|
it('should process entities', () => {
|
||||||
|
|
Loading…
Reference in a new issue