-
Notifications
You must be signed in to change notification settings - Fork 94
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
convertToHTML throws for "code-block" #182
Comments
Issue still exists |
fixed in 2.1.12, sorry for the delay! |
Got the same problem while trying to use 2.1.12 with react-draft-wysiwyg Demo |
Got the same problem using "draft-convert": "^2.1.13" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
convertToHTML
throwsconvertToHTML: missing HTML definition for block with type code-block
error whenContentState
block type iscode-block
.It's a confusing behavior given that
convertFromHTML
will convert<pre>
tags tocode-blocks
from the HTML input: https://github.com/HubSpot/draft-convert/blob/master/src/convertFromHTML.js#L185Steps to reproduce
Demo: https://codesandbox.io/s/draft-convert-missing-html-definition-for-block-with-type-code-block-54nt4?file=/src/App.js
Notes
Adding
'code-block': <pre />
to the default blocks (https://github.com/HubSpot/draft-convert/blob/master/src/default/defaultBlockHTML.js#L6) should fix the issue.The text was updated successfully, but these errors were encountered: