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

feat(about): render images in markdown #5732

Merged
merged 3 commits into from
Apr 5, 2023
Merged

Conversation

Jolg42
Copy link
Contributor

@Jolg42 Jolg42 commented Apr 4, 2023

Closes #5710

Description

It looks to me that why it works in the "Support" section is because it's using this.markdownService.enhancedMarkdownToHTML()
https://github.com/Chocobozzz/PeerTube/blob/00ee545c2444c35ed0d37df9f91984246aa36124/client/src/app/shared/shared-support-modal/support-modal.component.ts

which has different rules set in

export const ENHANCED_WITH_HTML_RULES = TEXT_WITH_HTML_RULES.concat([ 'image' ])
which allows image

So I changed the relevant line for the "About" page fields and now it works 🎊

Related issues

#5710

Has this been tested?

  • 👍 yes, I added tests to the test suite
  • 💭 no, because this PR is a draft and still needs work
  • 🙅 no, because this PR does not update server code
  • 🙋 no, because I need help
    Do we need to run or have a test for this?

Screenshots

Before
Screenshot 2023-04-04 at 15 39 15

After
Screenshot 2023-04-04 at 15 40 08

@Chocobozzz
Copy link
Owner

@Jolg42
Copy link
Contributor Author

Jolg42 commented Apr 5, 2023

@Chocobozzz thanks for the tip, I just did it and now on the admin the preview works too 🙌🏼
Screenshot 2023-04-05 at 10 54 48

@Jolg42
Copy link
Contributor Author

Jolg42 commented Apr 5, 2023

Note that I used markdownType="enhanced" (just checked it works on admin and public side) because [markdownType]="enhanced" would throw an error.

@Chocobozzz
Copy link
Owner

Thanks @Jolg42!

@Chocobozzz Chocobozzz merged commit 9258e9a into Chocobozzz:develop Apr 5, 2023
@Jolg42 Jolg42 deleted the patch-1 branch April 5, 2023 19:51
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.

Images in Markdown or in HTML
2 participants