Open platform to collect and prioritize feedback
Fixing quote functionality, adding quote icon to the comment editor
Albert Nimtzb4ed649f02e6
diff --git a/public/assets/images/heroicons-blockquote.svg b/public/assets/images/heroicons-blockquote.svgnew file mode 100644index 000000000..abf58e651--- /dev/null+++ b/public/assets/images/heroicons-blockquote.svg@@ -0,0 +1,4 @@+<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24">+ <path d="M4.583 17.321C3.553 16.227 3 15 3 13.011c0-3.5 2.457-6.637 6.03-8.188l.893 1.378c-3.335 1.804-3.987 4.145-4.247 5.621.537-.278 1.24-.375 1.929-.311 1.804.167 3.226 1.648 3.226 3.489a3.5 3.5 0 0 1-3.5 3.5c-1.073 0-2.099-.49-2.748-1.179zm10 0C13.553 16.227 13 15 13 13.011c0-3.5 2.457-6.637 6.03-8.188l.893 1.378c-3.335 1.804-3.987 4.145-4.247 5.621.537-.278 1.24-.375 1.929-.311 1.804.167 3.226 1.648 3.226 3.489a3.5 3.5 0 0 1-3.5 3.5c-1.073 0-2.099-.49-2.748-1.179z"/>+</svg>+diff --git a/public/components/common/form/CommentEditor.tsx b/public/components/common/form/CommentEditor.tsxindex 6e3c879a5..588e86ac9 100644--- a/public/components/common/form/CommentEditor.tsx+++ b/public/components/common/form/CommentEditor.tsx@@ -22,6 +22,7 @@ import IconOrderedList from "@fider/assets/images/heroicons-orderedlist.svg"import IconBulletList from "@fider/assets/images/heroicons-bulletlist.svg"import IconPhotograph from "@fider/assets/images/heroicons-photograph.svg"import IconLink from "@fider/assets/images/heroicons-link.svg"+import IconBlockquote from "@fider/assets/images/heroicons-blockquote.svg"import { DisplayError, hasError, Icon, ValidationContext } from "@fider/components"import { fileToBase64 } from "@fider/services"import { generateBkey } from "@fider/services/bkey"@@ -151,6 +152,15 @@ const MenuBar = ({><Icon sprite={IconCode} /></button>+ <button+ disabled={disabled}+ type="button"+ title="Quote"+ onClick={() => editor.chain().focus().toggleBlockquote().run()}+ className={`c-editor-button ${editor.isActive("blockquote") ? "is-active" : ""} ${disabled ? "is-disabled" : ""}`}+ >+ <Icon sprite={IconBlockquote} />+ </button><buttondisabled={disabled}type="button"diff --git a/public/services/markdown.ts b/public/services/markdown.tsindex 9120ffd18..0a5714962 100644--- a/public/services/markdown.ts+++ b/public/services/markdown.ts@@ -70,13 +70,9 @@ plainTextRenderer.code = (code) => codeplainTextRenderer.codespan = (code) => codeplainTextRenderer.html = (html) => htmlplainTextRenderer.del = (text) => text+plainTextRenderer.blockquote = (quote) => quote-const entities: { [key: string]: string } = {- "<": "<",- ">": ">",-}--const encodeHTML = (s: string) => s.replace(/[<>]/g, (tag) => entities[tag] || tag)+const encodeHTML = (s: string) => s.replace(/</g, "<")const stripTags = (input: string) => input.replace(/<[^>]*>/g, "")const sanitize = (input: string) => (DOMPurify.isSupported ? DOMPurify.sanitize(input) : stripTags(input))// Helper function to decode HTML entities back to readable characters