Skip to content

<strong> tag removing spaces if in between tags #473

Open

Description

@shayneg0

We're having issues with how tags are being outputted.

<strong>Hello World</strong> is showing the correct output of Hello World

But users are usually double clicking word for word to highlight and then select "Bold" resulting in
<strong>Hello</strong><strong>World</strong>

While in the editor is still has a space as "Hello World" but in the actual web page it shows "HelloWorld" it removes all spaces

Additional info

  • Craft version: 4.16.11
  • CKEditor version: 3.14.0

Activity

  1. linear commented on Sep 15, 2025

    @linear
  2. i-just commented on Sep 15, 2025

    @i-just
    Contributor

    Hi, thanks for getting in touch! I’m not able to reproduce this. Do you have any custom configuration in the CKEditor Config used by the field where this happens? Anything under “Config Options” in particular? Are you using any custom HTML Purifier config? How are you outputting the content of that field in your template?

  3. shayneg0 commented on Sep 16, 2025

    @shayneg0
    Author

    Hi, thanks for getting in touch! I’m not able to reproduce this. Do you have any custom configuration in the CKEditor Config used by the field where this happens? Anything under “Config Options” in particular? Are you using any custom HTML Purifier config? How are you outputting the content of that field in your template?

    Hello! Yeah we have this on config
    { "code": { "indentSequence": " " }, "link": { "addTargetToExternalLinks": true, "decorators": { "nofollow": { "attributes": { "rel": "nofollow" }, "label": "No-follow", "mode": "manual" } } } }
    And yes we have HTML Purifier on
    Image

    For the template it's just a regular twig output
    {{ article.content}}

  4. i-just commented on Nov 19, 2025

    @i-just
    Contributor

    Thanks! And what’s the content of your config/htmlpurifier/Default.json, please?

  5. shayneg0 commented on Nov 25, 2025

    @shayneg0
    Author

    Thanks! And what’s the content of your config/htmlpurifier/Default.json, please?

    Thanks for responding. Here's what we have:

    {
      "Attr.AllowedFrameTargets": [
        "_blank"
      ],
      "Attr.EnableID": true,
      "HTML.AllowedComments": [
        "pagebreak"
      ],
      "HTML.SafeIframe": true,
      "URI.SafeIframeRegexp": "%^(https?:)?//(www.youtube.com/embed/|player.vimeo.com/video/)%"
    }
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions