Skip to content

Commit

Permalink
web: Trim description
Browse files Browse the repository at this point in the history
  • Loading branch information
PaddiM8 committed Aug 10, 2024
1 parent 6fd5b7c commit 0fd7780
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 11 additions & 1 deletion web/src/lib/components/editor/Editor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,17 @@
export function getHtml(): Promise<string> {
return new Promise((resolve, _) => {
editor.update(() => {
resolve(generateHtmlFromNodes(editor));
let html = generateHtmlFromNodes(editor);
const emptyLineMarkups = [
'<p class="TicketEditorTheme__paragraph"><br></p>',
'<p class="TicketEditorTheme__paragraph" dir="ltr"><br></p>',
'<p class="TicketEditorTheme__paragraph" dir="rtl"><br></p>',
];
let toTrim: string | undefined;
while (toTrim = emptyLineMarkups.find(x => html.endsWith(x))) {
html = html.slice(0, -toTrim.length);
}
resolve(html);
});
});
}
Expand Down
2 changes: 0 additions & 2 deletions web/src/routes/(main)/projects/[user]/[slug]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,6 @@
toast.info("Created ticket successfully.");
if (data.project.allTicketsCount !== undefined && data.project.openTicketsCount !== undefined) {
//data.project.allTicketsCount++;
//data.project.openTicketsCount++;
refreshFilterMap();
}
}
Expand Down

0 comments on commit 0fd7780

Please sign in to comment.