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: crash markdown render code block without triple backtick #4248

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

urmauur
Copy link
Member

@urmauur urmauur commented Dec 9, 2024

Describe Your Changes

case is user write codeblock without backtick
The root cause is likely malformed Markdown content or the handling of raw HTML tags in the Markdown processor.

Changes in package.json

  • Removed Dependency: The package rehype-raw with version ^7.0.0 has been removed from the list of dependencies.

Changes in MarkdownTextMessage.tsx

  • Import Removal: The import statement for rehypeRaw has been deleted.
  • Plugin Removal:
    • rehypeRaw has been removed from the rehypePlugins array.
  • Attribute Change:
    • The skipHtml attribute, which was set to true, has been removed from the <Markdown> component.

Overall, the changes reflect the removal of the rehype-raw package and associated logic from the codebase, likely to improve security or simplify functionality by disallowing the use of raw HTML content in Markdown rendering.

Fixes Issues

CleanShot 2024-12-09 at 15 41 54

Self Checklist

  • Added relevant comments, esp in complex areas
  • Updated docs (for bug fixes / features)
  • Created issues for follow-up changes or refactoring needed

@urmauur urmauur added the type: bug Something isn't working label Dec 9, 2024
@urmauur urmauur added this to the v0.5.12 milestone Dec 9, 2024
@urmauur urmauur requested a review from louis-jan December 9, 2024 08:51
@urmauur urmauur self-assigned this Dec 9, 2024
Copy link
Contributor

@louis-jan louis-jan left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

github-actions bot commented Dec 9, 2024

Barecheck - Code coverage report

Total: 68.81%

Your code coverage diff: -0.01% ▾

Uncovered files and lines
FileLines
web/screens/Thread/ThreadCenterPanel/TextMessage/MarkdownTextMessage.tsx23, 26, 34-37, 39, 43, 50-52, 58, 61-63, 65, 70-71, 74, 124, 126-127, 132-133, 192

@urmauur urmauur merged commit 893d6ff into dev Dec 9, 2024
16 checks passed
@urmauur urmauur deleted the fix/crash-markdown branch December 9, 2024 09:18
Copy link
Contributor

github-actions bot commented Dec 9, 2024

This is the build for this pull request. You can download it from the Artifacts section here: Build URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: Markdown component crashes when rendering specific code block
2 participants