Skip to content

Rogue text can be created while editing an image. #47

@BE-Webdesign

Description

@BE-Webdesign

Not sure if this is a bug with contenteditable=true or what exactly, but it does lend to weird behavior.

phantom-text

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Type] BugAn existing feature does not function as intended[Type] TaskIssues or PRs that have been broken down into an individual action to take

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions