> quote stops working in preview???
> quote with <br/> <br/>
> new quote
> another quote like `this`
In preview mode, the following is displayed:
After submitting, the markdown is displayed as such:
Possible cause
Before the preview is displayed, the contents are sanitized using DOMPurify.sanitize(text) in comment-editor.component. However, during the submission of the form, the input is not sanitized. Similarly, the contents are not sanitized before being displayed when it is not in preview mode.
Possible solutions
Remove DOMPurify.sanitize. The ngx-markdown component by default sanitizes the contents (See the docs)
Alternatively, use DOMPurify.sanitize before uploading the contents to github. The downside is the user might see a different text if they want to edit it again. For example, it could be changed to:
Describe the bug For example, this is the raw issue comment (see https://github.com/chunweii/alpha8/issues/1):
In preview mode, the following is displayed:
After submitting, the markdown is displayed as such:
Possible cause Before the preview is displayed, the contents are sanitized using
DOMPurify.sanitize(text)
incomment-editor.component
. However, during the submission of the form, the input is not sanitized. Similarly, the contents are not sanitized before being displayed when it is not in preview mode.Possible solutions
Remove
DOMPurify.sanitize
. The ngx-markdown component by default sanitizes the contents (See the docs)Alternatively, use
DOMPurify.sanitize
before uploading the contents to github. The downside is the user might see a different text if they want to edit it again. For example, it could be changed to:> quote with <br/>
> new quote
> another quote like
this