mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-22 15:10:57 -05:00
merge: branch 'master' into production
This commit is contained in:
commit
1a9a2786bb
2 changed files with 9 additions and 5 deletions
|
@ -117,7 +117,11 @@ const Message = observer(
|
||||||
}
|
}
|
||||||
contrast={contrast}
|
contrast={contrast}
|
||||||
sending={typeof queued !== "undefined"}
|
sending={typeof queued !== "undefined"}
|
||||||
mention={message.mention_ids?.includes(client.user!._id)}
|
mention={
|
||||||
|
message.mention_ids && client.user
|
||||||
|
? message.mention_ids.includes(client.user._id)
|
||||||
|
: undefined
|
||||||
|
}
|
||||||
failed={typeof queued?.error !== "undefined"}
|
failed={typeof queued?.error !== "undefined"}
|
||||||
{...(attachContext
|
{...(attachContext
|
||||||
? useTriggerEvents("Menu", {
|
? useTriggerEvents("Menu", {
|
||||||
|
|
|
@ -180,9 +180,9 @@ const Container = styled.div<{ largeEmoji: boolean }>`
|
||||||
`;
|
`;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Regex for matching execessive blockquotes
|
* Regex for matching execessive recursion of blockquotes and lists
|
||||||
*/
|
*/
|
||||||
const RE_QUOTE = /(^(?:>\s?){5})[>\s?]+(.*$)/gm;
|
const RE_RECURSIVE = /(^(?:[>*+-][^\S\r\n]*){5})(?:[>*+-][^\S\r\n]*)+(.*$)/gm;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Regex for matching multi-line blockquotes
|
* Regex for matching multi-line blockquotes
|
||||||
|
@ -212,8 +212,8 @@ const RE_PLUS = /^\s*\+(?:$|[^+])/gm;
|
||||||
function sanitise(content: string) {
|
function sanitise(content: string) {
|
||||||
return (
|
return (
|
||||||
content
|
content
|
||||||
// Strip excessive blockquote indentation
|
// Strip excessive blockquote or list indentation
|
||||||
.replace(RE_QUOTE, (_, m0, m1) => m0 + m1)
|
.replace(RE_RECURSIVE, (_, m0, m1) => m0 + m1)
|
||||||
|
|
||||||
// Append empty character if string starts with html tag
|
// Append empty character if string starts with html tag
|
||||||
// This is to avoid inconsistencies in rendering Markdown inside/after HTML tags
|
// This is to avoid inconsistencies in rendering Markdown inside/after HTML tags
|
||||||
|
|
Loading…
Reference in a new issue