-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
#895 Adding an image to an empty rich text editor doesn't trigger the Image widget #926
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,9 @@ const image = { | |
image: match[2], | ||
alt: match[1], | ||
}, | ||
toBlock: data => ``, | ||
toBlock: data => ``, | ||
toPreview: (data, getAsset) => <img src={getAsset(data.image || '')} alt={data.alt || ''} />, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @erquhart I noticed that you modified this line as well in your 1.0 changes -- I had it as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @tech4him1 good catch, yes, that was unintentional. |
||
pattern: /^!\[([^\]]+)]\(([^)]+)\)$/, | ||
pattern: /^!\[([\S\s]*)\]\(([\S\s]*)\)$/, | ||
fields: [{ | ||
label: 'Image', | ||
name: 'image', | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Dammmien I'm just wondering why we want it to be
undefined
instead of an empty string, since that was just implemented recently. I'm not saying it's wrong, I'd just like a little background on why you can to change it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think his reasoning lies in comparison to the youtube component:
But yeah I agree, should be empty string. Have a commit going that I'll be pushing soon, should be good to merge after that.