not working

Sooo I just realized & nbsp ; (remove the spaces - I’m removing them to explain the issue) doesn’t work in Kirbytext, which is a problem because I need to be able to display these correctly for a French-language site.

Expected behavior vs actual behavior:
If I write “Bonjour& nbsp ;?” I should get “Bonjour ?” with the question mark “attached” to the “Bonjour” (it can’t get thrown to the next line, “Bonjour ?” behaves like a single word - quite like “Bonjour?” would).
Instead, I get “Bonjour ?” but the question mark may end up on the next line depending on how the text is being displayed (the question mark is its own word).

Upon inspection of the rendered html, it turned out the “& nbsp ;” symbol wasn’t present (whether it’s rendered by kirbytext() or html()). So I assume this is an issue of parsing?

Any clue as to how to circumvent this?

You may just copy the non-breaking-space you’re trying to use from this wikipedia page (first sentence). This way of inserting it directly should work just fine.

Okay, thanks a lot, it seems to be working (the code is & #160; without spaces). Cheers!

If you are a Mac user you can type a non-breakable space by hitting Option-Space. It it saved when the page is submitted.

1 Like