Skip to content

button is added to span with 'html-object-embed ck-widget ck-widget_selected' class. #16379

@lathalks

Description

@lathalks

📝 Provide detailed reproduction steps (if any)

I am adding a content in CKeditor 5 .The html content is

<div style="text-align:center;">
<button class=" btn btn-primary d-inline-block mt-4" data-bs-dismiss="modal" href="javascript:void(0);" id="closebtn"><span class="link">Close</span></button></span></div>

✔️ Expected result

<div style="text-align:center;">
<button class=" btn btn-primary d-inline-block mt-4" data-bs-dismiss="modal" href="javascript:void(0);" id="closebtn"><span class="link">Close</span></button></span></div>

What is the expected result of the above steps?

❌ Actual result

<div style="text-align:center;">
<span class="html-object-embed ck-widget ck-widget_selected" data-html-object-embed-label="HTML object" contenteditable="false"><button class="html-object-embed__content btn btn-primary d-inline-block mt-4" data-bs-dismiss="modal" data-ck-unsafe-attribute-href="javascript:void(0);" id="closebtn"><span class="link">Close</span></button></span></div>

What is the actual result of the above steps?

❓ Possible solution

I see there is a toObjectWidgetConverter() function in converter.js under html-support package which is converting to this.
Is there a way to stop this conversion.

📃 Other details

  • Browser: …
  • OS: …
  • First affected CKEditor version: …
  • Installed CKEditor plugins: …
    *These are the installed plugins.
    Alignment,
    AutoImage,
    AutoLink,
    Autoformat,
    BlockQuote,
    Bold,
    CKFinder,
    CKFinderUploadAdapter,
    Essentials,
    FindAndReplace,
    FontBackgroundColor,
    FontColor,
    FontFamily,
    FontSize,
    FullPage,
    GeneralHtmlSupport,
    RenderStyleElements,
    Heading,
    Highlight,
    HorizontalLine,
    HtmlComment,
    HtmlEmbed,
    Image,
    ImageCaption,
    ImageInsert,
    ImageResize,
    ImageStyle,
    ImageToolbar,
    //ImageUpload,
    Indent,
    IndentBlock,
    Italic,
    Link,
    LinkImage,
    List,
    Paragraph,
    PasteFromOffice,
    SelectAll,
    ShowBlocks,
    SourceEditing,
    SpecialCharacters,
    SpecialCharactersArrows,
    SpecialCharactersCurrency,
    SpecialCharactersEssentials,
    SpecialCharactersLatin,
    SpecialCharactersMathematical,
    SpecialCharactersText,
    StandardEditingMode,
    Strikethrough,
    Style,
    Subscript,
    Superscript,
    Table,
    TableCaption,
    TableCellProperties,
    TableColumnResize,
    TableProperties,
    TableToolbar,
    TodoList,
    Underline,
    Undo,
    MinimalisticModal

If you'd like to see this fixed sooner, add a 👍 reaction to this post.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugThis issue reports a buggy (incorrect) behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions