|
@@ -59,7 +59,6 @@ type PropsType = {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
type EditorRef = {
|
|
type EditorRef = {
|
|
|
- setGfmMode: (value: boolean) => void,
|
|
|
|
|
setValue: (value: string) => void,
|
|
setValue: (value: string) => void,
|
|
|
insertText: (text: string) => void,
|
|
insertText: (text: string) => void,
|
|
|
terminateUploadingState: () => void,
|
|
terminateUploadingState: () => void,
|
|
@@ -97,14 +96,6 @@ const CommentEditor = (props: PropsType): JSX.Element => {
|
|
|
setComment(value);
|
|
setComment(value);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const updateStateCheckbox = (event) => {
|
|
|
|
|
- if (editorRef.current == null) { return }
|
|
|
|
|
- const value = event.target.checked;
|
|
|
|
|
- setIsMarkdown(value);
|
|
|
|
|
- // changeMode
|
|
|
|
|
- editorRef.current.setGfmMode(value);
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
const renderHtml = (markdown: string) => {
|
|
const renderHtml = (markdown: string) => {
|
|
|
const context = {
|
|
const context = {
|
|
|
markdown,
|
|
markdown,
|
|
@@ -351,27 +342,6 @@ const CommentEditor = (props: PropsType): JSX.Element => {
|
|
|
|
|
|
|
|
<div className="comment-submit">
|
|
<div className="comment-submit">
|
|
|
<div className="d-flex">
|
|
<div className="d-flex">
|
|
|
- <label className="mr-2">
|
|
|
|
|
- {activeTab === 'comment_editor' && (
|
|
|
|
|
- <span className="custom-control custom-checkbox">
|
|
|
|
|
- <input
|
|
|
|
|
- type="checkbox"
|
|
|
|
|
- className="custom-control-input"
|
|
|
|
|
- id="comment-form-is-markdown"
|
|
|
|
|
- name="isMarkdown"
|
|
|
|
|
- checked={isMarkdown}
|
|
|
|
|
- value="1"
|
|
|
|
|
- onChange={updateStateCheckbox}
|
|
|
|
|
- />
|
|
|
|
|
- <label
|
|
|
|
|
- className="ml-2 custom-control-label"
|
|
|
|
|
- htmlFor="comment-form-is-markdown"
|
|
|
|
|
- >
|
|
|
|
|
- Markdown
|
|
|
|
|
- </label>
|
|
|
|
|
- </span>
|
|
|
|
|
- ) }
|
|
|
|
|
- </label>
|
|
|
|
|
<span className="flex-grow-1" />
|
|
<span className="flex-grow-1" />
|
|
|
<span className="d-none d-sm-inline">{ errorMessage && errorMessage }</span>
|
|
<span className="d-none d-sm-inline">{ errorMessage && errorMessage }</span>
|
|
|
|
|
|