Compare commits

...

3 commits

Author SHA1 Message Date
JackDotJS
1bedf4dc70
Merge 28c897ac3d into 478d375125 2024-11-15 10:42:40 -08:00
Paul Makles
478d375125 fix: add try-catch block around md renderer
fix: update recursive match to block numbered lists
2024-11-15 13:09:40 +00:00
JackDotJS
28c897ac3d fix(settings): fixed inability to rename categories when they have blank names
Signed-off-by: JackDotJS <jackdotjs@proton.me>
2024-10-27 11:14:04 -07:00
2 changed files with 13 additions and 6 deletions

View file

@ -185,7 +185,8 @@ const Container = styled.div<{ largeEmoji: boolean }>`
/**
* Regex for matching execessive recursion of blockquotes and lists
*/
const RE_RECURSIVE = /(^(?:[>*+-][^\S\r\n]*){5})(?:[>*+-][^\S\r\n]*)+(.*$)/gm;
const RE_RECURSIVE =
/(^(?:(?:[>*+-]|\d+\.)[^\S\r\n]*){5})(?:(?:[>*+-]|\d+\.)[^\S\r\n]*)+(.*$)/gm;
/**
* Regex for matching multi-line blockquotes
@ -247,9 +248,13 @@ export default memo(({ content, disallowBigEmoji }: MarkdownProps) => {
const [Content, setContent] = useState<React.ReactElement>(null!);
useLayoutEffect(() => {
render
.process(sanitisedContent)
.then((file) => setContent(file.result));
try {
render
.process(sanitisedContent)
.then((file) => setContent(file.result));
} catch (err) {
setContent("Message failed to render." as never);
}
}, [sanitisedContent]);
const largeEmoji = useMemo(

View file

@ -369,7 +369,9 @@ function ListElement({
<KanbanList last={false} key={category.id}>
<div className="inner">
<Row>
<KanbanListHeader {...provided.dragHandleProps}>
<KanbanListHeader
{...provided.dragHandleProps}
onClick={startEditing}>
{editing !== undefined ? (
<input
value={editing}
@ -384,7 +386,7 @@ function ListElement({
id={category.id}
/>
) : (
<span onClick={startEditing}>
<span>
{category.title}
</span>
)}