-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Rogue text can be created while editing an image. #47
Copy link
Copy link
Closed
Labels
[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended[Type] TaskIssues or PRs that have been broken down into an individual action to takeIssues or PRs that have been broken down into an individual action to take
Description
Not sure if this is a bug with contenteditable=true or what exactly, but it does lend to weird behavior.
You are able to create a raw text node within the editor by adding text below an image. No content block created for it. You could move the image up and down and create more rogue text nodes throughout the document.
One solutionish thing would be to scan the editor for text nodes when a block is selected, like:
// psuedo code
const findTextNodes = ( node ) => {
return Array.from( node.childNodes ).filter( childNode => childNode.nodeName === '#text' );
}
textNodes = findTextNodes( queryFirst( '.editor' ) )and then destroy the text node(s) and wrap it in a <p> instead.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended[Type] TaskIssues or PRs that have been broken down into an individual action to takeIssues or PRs that have been broken down into an individual action to take
Type
Fields
Give feedbackNo fields configured for issues without a type.
