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

Enable Comrak support for style alerts in Markdown #10429

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kbdharun
Copy link

@kbdharun kbdharun commented Jan 21, 2025

This PR enables alerts (for GitHub style alerts kivikakk/comrak#519) and multiline_block_quotes (for GitLab multiline blockquotes kivikakk/comrak#521) Comrak extensions that were added/modified in the recent release https://github.com/kivikakk/comrak/releases/tag/v0.34.0, to the Crates Markdown renderer.

Related discussion: #8506


While I was able to build the frontend as well as backend via Docker, I have not tested the rendering with a sample crates package (due to my unfamiliarity with the codebase). Any help with testing this and adding test cases for style alerts would be appreciated.

Extension docs:

https://docs.rs/comrak/0.34.0/comrak/struct.ExtensionOptionsBuilder.html#method.alerts
https://docs.rs/comrak/0.34.0/comrak/struct.ExtensionOptionsBuilder.html#method.multiline_block_quotes

@kbdharun kbdharun changed the title Enable Comark support for style alerts in Markdown Enable Comrak support for style alerts in Markdown Jan 21, 2025
@Turbo87
Copy link
Member

Turbo87 commented Jan 21, 2025

https://github.com/rust-lang/crates.io/blob/main/tests/acceptance/readme-rendering-test.js
http://localhost:4040/tests?filter=Acceptance%20|%20README%20rendering

Any help with testing this and adding test cases for style alerts would be appreciated.

we need two test cases:

  1. checking the conversion of the markdown alert into an HTML alert. this should be added at the bottom of the file in the crates_io_markdown crate, which already has a bunch of similar tests.

  2. checking the styling of the HTML alerts. you can find a basic smoke test for the rendering at https://github.com/rust-lang/crates.io/blob/main/tests/acceptance/readme-rendering-test.js. if you run pnpm start you should be able to visit http://localhost:4040/tests?filter=Acceptance%20|%20README%20rendering and see it in action. if you replace wait percySnapshot(assert); with await this.pauseTest(); you can pause the test and manually check if the styling matches your expectation.

@Turbo87 Turbo87 added the C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works label Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants