Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Fix #498 #1903

Closed
wants to merge 1 commit into from
Closed

WIP: Fix #498 #1903

wants to merge 1 commit into from

Conversation

Jorropo
Copy link
Contributor

@Jorropo Jorropo commented Jun 13, 2019

Fix #498

I cant actualy make it works.
For an unknown reason <br /> got been escaped while the same code doesn't do this in :

client/src/app/videos/+video-watch/video-watch.component.ts

It seems to be done by avoidTruncatedTags in :

client/src/app/shared/renderer/markdown.service.ts

but again in :

client/src/app/videos/+video-watch/video-watch.component.ts

this doesn't happend and I cant get why.

@Chocobozzz
Copy link
Owner

Because in video watch we inject the HTML:

<div class="video-info-description-html" [innerHTML]="videoHTMLDescription"></div>

If you add basic markdown in comments, please add a preview bloc when writing the comment.

@Jorropo
Copy link
Contributor Author

Jorropo commented Jun 14, 2019

@Chocobozzz this is the same things here :

<div class="comment-html" [innerHTML]="sanitizedCommentHTML"></div>

And the problem is <br /> transform to &lt;br /&gt; after been returned from await this.markdownService.textMarkdownToHTML(this.comment.text).
I've thinked to first make the text in await this.htmlRenderer.toSafeHtml(this.comment.text) but nothing change (logical because that not linked).

If you add basic markdown in comments, please add a preview bloc when writing the comment.

Yes, that a good idea, I didn't even think of that. Would you the preview in the bottom of the writing box (the preview box should open only when you are writing), asside of the write box (not disponible for mobile), or in a preview tab (like github does) ? (I think first one is the best)

@Chocobozzz
Copy link
Owner

And the problem is
transform to <br /> after been returned from await this.markdownService.textMarkdownToHTML(this.comment.text).
I've thinked to first make the text in await this.htmlRenderer.toSafeHtml(this.comment.text) but nothing change (logical because that not linked).

Ah yes sorry. Try to create another markdown renderer that accepts html (because we already sanitized it): https://github.com/markdown-it/markdown-it#init-with-presets-and-options

Yes, that a good idea, I didn't even think of that. Would you the preview in the bottom of the writing box (the preview box should open only when you are writing), asside of the write box (not disponible for mobile), or in a preview tab (like github does) ? (I think first one is the best)

I have no preference :)

@rigelk
Copy link
Collaborator

rigelk commented Dec 8, 2019

@Jorropo do you plan on finishing this PR, or do you need help with it?

@Chocobozzz
Copy link
Owner

Implemented in 1aa7543

@Chocobozzz Chocobozzz closed this Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Basic markdown formatting in comments
3 participants