feat: pass strikethrough markdown for hint message on field (#5727)

Co-authored-by: Jonas Matos <js.matos@sidi.org.br>
This commit is contained in:
Jonas Matos
2021-09-10 12:12:09 -03:00
committed by GitHub
parent 787e80c60a
commit 27f04484e6
4 changed files with 118 additions and 4 deletions

View File

@ -65,6 +65,7 @@
"redux-devtools-extension": "^2.13.8",
"redux-notifications": "^4.0.1",
"redux-thunk": "^2.3.0",
"remark-gfm": "1.0.0",
"sanitize-filename": "^1.6.1",
"semaphore": "^1.0.5",
"tomlify-j0.4": "^3.0.0-alpha.0",

View File

@ -9,6 +9,7 @@ import { partial, uniqueId } from 'lodash';
import { connect } from 'react-redux';
import { FieldLabel, colors, transitions, lengths, borders } from 'netlify-cms-ui-default';
import ReactMarkdown from 'react-markdown';
import gfm from 'remark-gfm';
import { resolveWidget, getEditorComponents } from '../../../lib/registry';
import { clearFieldErrors, tryLoadEntry, validateMetaField } from '../../../actions/entries';
@ -330,7 +331,8 @@ class EditorControl extends React.Component {
{fieldHint && (
<ControlHint active={isSelected || this.state.styleActive} error={hasErrors}>
<ReactMarkdown
allowedElements={['a', 'strong', 'em']}
remarkPlugins={[gfm]}
allowedElements={['a', 'strong', 'em', 'del']}
unwrapDisallowed={true}
components={{
// eslint-disable-next-line no-unused-vars