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

Removed disallowedElementsMarkdown #555

Merged
merged 1 commit into from
Sep 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import MDEditor, { PreviewType } from "@uiw/react-md-editor";
import { disallowedElementsMarkdown } from "constants/constants";
import { allowedElementsMarkdown } from "constants/constants";

Choose a reason for hiding this comment

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

Image description CodeRabbit

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";

import { forwardRef } from "react";
import { parseIsDirty } from "../utils";
import { StyledFormMDEditor } from "./styles";
Expand Down Expand Up @@ -37,7 +37,7 @@ export const FormMDEditorComponent = (
>
<MDEditor
value={value}
previewOptions={{ disallowedElements: disallowedElementsMarkdown }}
previewOptions={{ allowedElements: allowedElementsMarkdown }}

Choose a reason for hiding this comment

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

Image description CodeRabbit

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 }}

onChange={(value) => (disabled ? undefined : onChange(value ?? ""))}
minHeight={200}
height={400}
Expand Down