Skip to content

Commit

Permalink
(feat) Make the label in FormField optional to support Markdown conte…
Browse files Browse the repository at this point in the history
…nt (#411)

* feat: Tweak the markdown support

* updating yarn.lock

* remove rehype-raw and remark-gfm
  • Loading branch information
Twiineenock authored Oct 21, 2024
1 parent 0e10380 commit 4e0d67d
Show file tree
Hide file tree
Showing 4 changed files with 5,117 additions and 4,235 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"lodash-es": "^4.17.21",
"react-error-boundary": "^4.0.13",
"react-hook-form": "^7.52.0",
"react-markdown": "^7.1.2",
"react-markdown": "^9.0.1",
"react-waypoint": "^10.3.0",
"react-webcam": "^7.2.0"
},
Expand Down
12 changes: 11 additions & 1 deletion src/components/inputs/markdown/markdown-wrapper.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@ const MarkdownWrapper: React.FC<{ markdown: string | string[] }> = ({ markdown }
<ReactMarkdown
children={Array.isArray(markdown) ? markdown.join('\n') : markdown}
unwrapDisallowed={true}
allowedElements={['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'strong', 'em']}
allowedElements={[
'h1',
'h2',
'h3',
'h4',
'h5',
'h6',
'p',
'strong',
'em',
]}
/>
);
};
Expand Down
2 changes: 1 addition & 1 deletion src/types/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export interface FormSection {
}

export interface FormField {
label: string;
label?: string;
type: string;
questionOptions: FormQuestionOptions;
datePickerFormat?: 'both' | 'calendar' | 'timer';
Expand Down
Loading

0 comments on commit 4e0d67d

Please sign in to comment.