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

Fix buggy code blocks in markdown renderer #3764

Merged
merged 13 commits into from
Jan 8, 2025

Conversation

chrisvanrun
Copy link
Contributor

@chrisvanrun chrisvanrun commented Dec 20, 2024

Old HTML render:

image

New HTML render:

image

Likely this PR fixes some other incorrect visuals since the base extension only handled snippets. I've only discovered the <code> one.

@chrisvanrun chrisvanrun requested a review from jmsmkn as a code owner December 20, 2024 15:52
@chrisvanrun chrisvanrun linked an issue Dec 20, 2024 that may be closed by this pull request
@jmsmkn jmsmkn self-assigned this Jan 6, 2025
@koopmant
Copy link
Contributor

koopmant commented Jan 7, 2025

I propose to add some extra css to fix a missing bottom margin after the codeblocks have been converted:
in app/grandchallenge/core/static/css/base.scss:

div.codehilite {
    margin-bottom: $paragraph-margin-bottom;
}

image

image

@jmsmkn jmsmkn assigned chrisvanrun and unassigned jmsmkn Jan 7, 2025
app/config/settings.py Outdated Show resolved Hide resolved
Copy link
Member

@jmsmkn jmsmkn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be reworked so that mark_safe is not used as this opens up XSS vulnerabilities.

@jmsmkn jmsmkn assigned jmsmkn and unassigned chrisvanrun Jan 8, 2025
@jmsmkn jmsmkn removed their assignment Jan 8, 2025
@jmsmkn jmsmkn merged commit 000bf40 into main Jan 8, 2025
8 checks passed
@jmsmkn jmsmkn deleted the 3592-code-blocks-buggy-in-markdown-renderer branch January 8, 2025 12:59
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.

Code blocks buggy in markdown renderer
3 participants