Sign in

Non-breaking space in HTML block

  • This topic has 5 replies, 4 voices, and was last updated 1 year, 8 months ago by .
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #6364
    Avatar photoshaun2k

    Hi,

    I’m using HTML block in Block Editor and tried to include the non-breaking space character (&nbsp;) in a paragraph to keep two words together in a <p> block. However, instead of a space between the two words, it shows an ampersand character.

    Alternatively, if I used the WYSIWYG Editor’s “HTML Source code”, the non-breaking space character (&nbsp;) gets stripped but replaced by normal space.

    Is there a work-around?

    Thanks

     

    #6401
    Avatar photoTomasz Dziuda

    Hi,

    It seems that some filtering does bad job with &nbsp; entities. I will need to fix it in the next release.

    Temporary solution can be use of & # 160; entity (remove spaces from it) – it works for me 🙂

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #6404
    Avatar photoshaun2k

    Thanks for the workaround, Tomasz.

    #6837
    Avatar photoGyges

    Hi there,

    to my own testing both & # 160; and & nbsp; work.
    However, these entities do not show up when you once again hit the HTML mode button, they are gone, invisible or something. Yet nbsp keeps working until you further edit the paragraph. Adding a single space after the nbsp’ed text is enough to revert the nbsp’s, no matter which method you used.

    #6838
    Avatar photoitips3727
    Gyges wrote:

    Hi there,

    to my own testing both & # 160; and & nbsp; work.

    However, these entities do not show up when you once again hit the HTML mode button, they are gone, invisible or something. Yet nbsp keeps working until you further edit the paragraph. Adding a single space after the nbsp’ed text is enough to revert the nbsp’s, no matter which method you used.

    That’s weird. On my setup, the HTML non-breaking space ( &nbsp; ) code stays in place after saving the page. You can check it with DevTools turned on in Publii (with the DevTools parked at the bottom of the screen rather than the side). Then select the element to ‘zoom in’.

    I’m using I guess what might be called a ‘standard setup’– that is: the current latest Publii v.0.38.3 (build 14238) under Apple macOS Monterey, v12.2.

    So maybe there’s some issue with your setup.

    #6851
    Avatar photoGyges

    Hi there,

    a great 1-minute-solution for the WYSIWIG editor has been provided by Bob in Post 6 of this Github issue:

    https://github.com/GetPublii/Publii/issues/1062

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.