-
Notifications
You must be signed in to change notification settings - Fork 13
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
Removed disallowedElementsMarkdown #555
Conversation
WalkthroughThe change primarily focuses on enhancing the markdown preview functionality in the Changes
Uplevel your code reviews with CodeRabbit ProCodeRabbit ProIf you like this project, please support us by purchasing the Pro version. The Pro version has advanced context, superior noise reduction and several proprietary improvements compared to the open source version. Moreover, CodeRabbit Pro is free for open source projects. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Files selected (1)
- packages/web/src/components/FormControls/FormMDEditor/FormMDEditor.tsx (2)
Review comments generated (2)
- Review: 2
- LGTM: 0
Tips
Chat with CodeRabbit Bot (@coderabbitai
)
- Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
- Invite the bot into a review comment chain by tagging
@coderabbitai
in a reply.
Code suggestions
- The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
- You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.
Pausing incremental reviews
- Add
@coderabbitai: ignore
anywhere in the PR description to pause further reviews from the bot.
@@ -1,5 +1,5 @@ | |||
import MDEditor, { PreviewType } from "@uiw/react-md-editor"; | |||
import { disallowedElementsMarkdown } from "constants/constants"; | |||
import { allowedElementsMarkdown } from "constants/constants"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The import statement has been changed from disallowedElementsMarkdown
to allowedElementsMarkdown
. Ensure that the allowedElementsMarkdown
constant is correctly defined and contains all the necessary elements that should be allowed in the markdown editor. If it doesn't, you might face issues with rendering certain elements in the preview.
- import { disallowedElementsMarkdown } from "constants/constants";
+ import { allowedElementsMarkdown } from "constants/constants";
@@ -37,7 +37,7 @@ export const FormMDEditorComponent = ( | |||
> | |||
<MDEditor | |||
value={value} | |||
previewOptions={{ disallowedElements: disallowedElementsMarkdown }} | |||
previewOptions={{ allowedElements: allowedElementsMarkdown }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previewOptions
prop of the MDEditor
component now uses allowedElementsMarkdown
instead of disallowedElementsMarkdown
. This change implies a shift from a blacklist approach to a whitelist approach for controlling what elements are rendered in the markdown preview. Make sure that this change aligns with your application's requirements and that all necessary elements are included in allowedElementsMarkdown
.
- previewOptions={{ disallowedElements: disallowedElementsMarkdown }}
+ previewOptions={{ allowedElements: allowedElementsMarkdown }}
Deploying with Cloudflare Pages
|
Summary by CodeRabbit
FormMDEditor
component in the web package. The markdown preview options have been modified to only render specified elements, enhancing security and control over content display. This change improves the user experience by ensuring that only approved markdown elements are visible in the preview.