GithubHelp home page GithubHelp logo

Comments (4)

Dumluregn avatar Dumluregn commented on July 4, 2024 1

Issue details:

  1. It reproduces for any content with the following pattern: block element + non-paragraph element that needs autoparagraphing (soft break, text etc) + block element.
  2. When such content is pasted/dropped into the editor, only the middle part is autoparagraphed, which later causes a positions mismatch inside
    private _updateLastNodeFromAutoParagraph( node: Node ): void {
    const positionAfterLastNode = this.writer.createPositionAfter( this._lastNode! );
    const positionAfterNode = this.writer.createPositionAfter( node );
    // If the real end was after the last auto paragraph then update relevant properties.
    if ( positionAfterNode.isAfter( positionAfterLastNode ) ) {
    this._lastNode = node;
    /* istanbul ignore if -- @preserve */
    if ( this.position.parent != node || !this.position.isAtEnd ) {
    // Algorithm's correctness check. We should never end up here but it's good to know that we did.
    // At this point the insertion position should be at the end of the last auto paragraph.
    // Note: This error is documented in other place in this file.
    throw new CKEditorError( 'insertcontent-invalid-insertion-position', this );
    }
    this.position = positionAfterNode;
    this._setAffectedBoundaries( this.position );
    }
    }
    .
  3. If ImageInline plugin is loaded, pasted image becomes <imageInline> instead. Then the whole content goes into an autoparagraph so the positions are correct and the issue does not occur.

I added a failing unit test and images to the imageBlock manual test for easy issue reproduction at ck/16321-invalid-insert-content branch.

from ckeditor5.

Dumluregn avatar Dumluregn commented on July 4, 2024

Hello, thank you for reporting and providing a sample repo. Unfortunately, I wasn't able to reproduce the issue - see the recording below.

Screen.Recording.2024-05-20.at.13.38.55.mov

It would be best if you are able to also send a recording showing the exact use case, so showing the source you are copying the content from, and the editor state when you are pasting it.

from ckeditor5.

Joel-Levi avatar Joel-Levi commented on July 4, 2024
recording.webm

I am dragging the content that is in the reproduction page into the editor.
You can see nothing is rendered, until I press a button

from ckeditor5.

Dumluregn avatar Dumluregn commented on July 4, 2024

Thank you, I can reproduce the problem and will investigate it.

from ckeditor5.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.