mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-09 10:15:26 +00:00
fix: ensure blockquotes are broken
This commit is contained in:
@@ -184,6 +184,11 @@ const Container = styled.div<{ largeEmoji: boolean }>`
|
|||||||
*/
|
*/
|
||||||
const RE_QUOTE = /(^(?:>\s){5})[>\s]+(.*$)/gm;
|
const RE_QUOTE = /(^(?:>\s){5})[>\s]+(.*$)/gm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Regex for matching multi-line blockquotes
|
||||||
|
*/
|
||||||
|
const RE_BLOCKQUOTE = /^([^\S\r\n]*>[^\n]+\n?)+/gm;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Regex for matching HTML tags
|
* Regex for matching HTML tags
|
||||||
*/
|
*/
|
||||||
@@ -214,6 +219,9 @@ function sanitise(content: string) {
|
|||||||
// because remark renderer is collapsing empty
|
// because remark renderer is collapsing empty
|
||||||
// or otherwise whitespace-only lines of text
|
// or otherwise whitespace-only lines of text
|
||||||
.replace(RE_EMPTY_LINE, "")
|
.replace(RE_EMPTY_LINE, "")
|
||||||
|
|
||||||
|
// Ensure empty line after blockquotes for correct rendering
|
||||||
|
.replace(RE_BLOCKQUOTE, (match) => `${match}\n`)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user