- Do you want to request a feature or report a bug?
bug
- What is the current behavior?
When triple clicking a line of text in a markdown editor within an editor component, all the text gets selected:
But if I then apply styling to the selection, it only applies to the exact word I originally triple clicked on:
This does not happen in the "main" markdown editor, so I assume this isn't a bug in slate.js, but rather has to do with netlify-cms' integration, perhaps related to #1393
- If the current behavior is a bug, please provide the steps to reproduce.
markdown
widget:CMS.registerEditorComponent({
id: "youtube",
label: "Youtube",
fields: [{
name: 'id',
label: 'Youtube Video ID',
widget: 'markdown'
}],
pattern: /^youtube (\S+)$/,
fromBlock: function(match) {
return { id: match[1] };
},
toBlock: function(obj) {
return 'youtube ' + obj.id;
},
toPreview: function(obj) {
return (
'<img src="http://img.youtube.com/vi/' + obj.id + '/maxresdefault.jpg" alt="Youtube Video"/>'
);
}
});
Observe that the bold styling only applies to the word that was triple clicked, rather than all the text that is selected.
The same thing happens when applying italics and creating a link.
- What is the expected behavior?
That the styling applies to all the selected text.
- Please mention your versions where applicable.
Netlify CMS version: 1.8.4
Browser version: Chrome 67.0.3396.62/OSX
Node.JS version: 9.5.0
Operating System: Mac OSX 10.13.4 (High Sierra)
- Please link or paste your config.yml
below if applicable.
I think it's safe to say that markdown widgets inside of markdown widgets are just busted at this point, lots and lots of bugs there.
Related to this when you attempt to drag select text it attempts to drag the component and not select the text
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.