cancel
Showing results for 
Search instead for 
Did you mean: 
mclean
Community Participant

How do you insert a non-breaking space?

In a Canvas page, that is.

This seems super-basic, but I can't find anything better than switching into HTML Editor mode.  Some insert menu would be OK, but I'm really hoping for a keyboard shortcut.  (macOS, if it makes a difference.)

9 Replies
chofer
Community Coach
Community Coach

Hi  @mclean ...

A non-breaking space in HTML code usually uses:

 ‍‍

.  But that's essentially the same as any space between two words.  So, in HTML code, an example of:

<p>The panda...</p>

     or

<p>The&nbsp;panda...</p>

...will produce the same result to the end-user:

The panda...

Is this what you are looking for?  Or, are you asking for something different than this?

mclean
Community Participant

I know what a non-breaking space is (it does not produce the same result to the end-user, when there is the potential for line wrapping as demonstrated by this clause), and I know how to put one into HTML code (as I indicated in my question).  I was asking whether there was a less cumbersome method than that.  Most WYSIWYG and Rich Content editors that I know of either provide an "Insert Symbol" palette that includes a non-breaking space, OR (even better) recognize a key sequence such as Ctl-Shft-space.  Does the editor in Canvas provide anything like that?

chofer
Community Coach
Community Coach

Hi James...

Oh...I understand better now.  To answer your question, I don't see any tools in the RCE that allow for this.  Even when I placed my cursor in the RCE and did an Alt+F9 on my keyboard (not sure what the combo is on a Mac) to show a hidden File, Edit, Insert... menu, I couldn't find any options there that would allow you to insert a non-breaking space.  😞

dwillmore
Community Champion

Thanks for putting this into the Community.   I gained knowledge.

mclean
Community Participant

Ah well.  Silver lining: You have taught me about the hidden menu bar! (The Mac keys are the same, except that Mac primarily calls the "Alt" key as "Option.")  Time for a feature request...

James
Community Champion

 @mclean ,

Edit: It appears that Jive strips all of the & followed by nbsp; and just puts in a space, so I've had to go through and edit the document. Hopefully I caught all references. Ignore the space I had to add to them.

I'm not a big fan of & nbsp; -- in fact, I have a macro written that will go through and replace all occurrences of them with a regular space. Canvas tends to put them in when they're not needed. About the only time I use them is when I need the units on a number to stick with the number, but that is very rarely in anything I do inside Canvas.

That said, here's a hack. You'll still have to go into the HTML editor, but at least it's easier to enter them in the first place.

When you press the space bar you get a regular space. Additional presses of the space bar add & nbsp;. This is undesirable for all of us who learned to double space at the end of a sentence and still do it sometimes. I don't want additional spaces, I want a single space. Other programs, like DreamWeaver, won't let me enter additional spaces without specifically making them a non-breaking one with a special keystroke like you mentioned (shift+space).

Anyway, what you have is a regular space followed by a non-breaking space. Unfortunately for you, if you try to remove either space, the Rich Content Editor will strip out the & nbsp; and leave just the regular space.

So, here's the hack.

You can double space wherever you want a non-breaking space to appear. Then switch to the HTML editor mode and search for a regular space followed by & nbsp;. In the HTML editor mode, you strip out the regular space from the beginning, leaving just the & nbsp; and it will keep it.

Still not as quick as having a dedicated keystroke, but perhaps faster than manually inserting the & nbsp; yourself.

Another hack that still requires the HTML editor portion is to type your document as normal using the Rich Content Editor. Then switch to the HTML editor when you are done and find the place where you need the non-breaking spaces to be. Remove the regular space that's there and hit Option+Space on your Mac. It will insert what looks like a regular space, but it's really a non-breaking space and when you switch back or save it will convert to & nbsp;. & nbsp;Trying this& nbsp;directly from the Rich Content Editor (not the HTML editor) will just give you a regular space.

dwillmore
Community Champion

Now my head hurts.    Just too much space in the skull I guess.

mclean
Community Participant

Thanks to James Jones for the work-around ideas.  I'm also not looking to have nbsp all over the place; but when it is the right tool, nothing else really comes close.  (Assignment: Read Ch.nbsp3)

James' ideas clarify for me the biggest difficulty: if you have to switch into HTML mode, then you have to search for the desired entry point.  Compared to that, any method of entering the nbsp entity is small potatoes.

I've added this as a feature request, at https://community.canvaslms.com/ideas/9689-make-symbols-available-in-pages-editor .  If anyone cares to give it a vote, that would be nice.  Also see there James Jones' link to the very similar (and older) request for foreign language symbols.

chofer
Community Coach
Community Coach

Hi  @mclean ...

Thanks for posting this update.  It sounds like this question has been answered, so I am going to mark it as "Assumed Answered" because there hasn't been any new activity in this thread for over two months.  However, if you feel there is one "Correct" answer above, please go ahead and mark that response as such.  People will still be able to post additional questions and comments below that are related to this topic.  Thanks again, James!