Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#28448 closed feature request (worksforme)

Add non-breaking space to the editor (special character)

Reported by: benoitchantre's profile benoitchantre Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.9
Component: TinyMCE Keywords:
Focuses: ui Cc:

Description

Sometimes, we need to manually insert non-breaking spaces in the text.

It would be nice to have that option directly in the editor with the other special chars.

Change History (5)

#1 follow-ups: @MikeHansenMe
10 years ago

  • Type changed from enhancement to defect (bug)

I took a quick look and when you click the special char icon the top left square is a non-breaking space. However when you click it it does not insert anything. I think this is a tinymce plugin. Changing from an enhancement to bug.

#2 @SergeyBiryukov
10 years ago

  • Component changed from Editor to TinyMCE

#3 in reply to: ↑ 1 @azaozz
10 years ago

  • Keywords close added
  • Type changed from defect (bug) to feature request

This is a bit more complex: on getting the content from the editor we encode only <, >, and & as entities, all the rest including &nbsp; are converted to UTF-8 characters. So even if there is an &nbsp;, it becomes "invisible" in the Text editor or when looking at the HTML source.

Replying to MikeHansenMe:

I think this is a tinymce plugin.

There is indeed a TinyMCE plugin that adds a button to insert non-breaking space: https://github.com/tinymce/tinymce/blob/master/js/tinymce/plugins/nonbreaking/plugin.js. Don't think it should be included by default in WordPress, there are several plugins that add it.

#4 in reply to: ↑ 1 @SergeyBiryukov
10 years ago

Replying to MikeHansenMe:

I took a quick look and when you click the special char icon the top left square is a non-breaking space. However when you click it it does not insert anything.

Adding a non-breaking space via the Special character dialog works as expected for me. It looks like a regular space, but I've confirmed that it's a non-breaking space by saving the resulting HTML source into a file an inspecting it.

I think this accomplishes what this ticket is asking for.

#5 @iseulde
10 years ago

  • Keywords close removed
  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed
  • Version changed from 3.9.1 to 3.9
Note: See TracTickets for help on using tickets.