# Native support for unicode No Break space

**URL:** <https://talk.commonmark.org/t/native-support-for-unicode-no-break-space/2251>\
**Category:** Spec\
**Created:** [October 4, 2016, 11:31am UTC](https://talk.commonmark.org/t/native-support-for-unicode-no-break-space/2251 "2016-10-04T11:31:40Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yannk](https://cdn.commonmark.org/letter_avatar_proxy/v2/letter/y/e480ec/32.png) [@Yannk](https://talk.commonmark.org/u/Yannk)\
**Post date:** [October 4, 2016, 11:31am UTC](https://talk.commonmark.org/t/native-support-for-unicode-no-break-space/2251/1 "2016-10-04T11:31:40Z")

</div>

Hello,  
I am using markdown for narrative texts and I would like to optimize my workflow. One of my drawback is that I can’t get my files to take care of No Break Space written in Unicode. Do you plan to have native support for unicode U+00A0 ?

I have made a try on [http://spec.commonmark.org/dingus/](http://spec.commonmark.org/dingus/) and I can’t get my no break space taken in account if I insert it with Ctrl+Shift+0020  
But if I type &nbsp; it is ok.  
Do I make something wrong ? Is there any way to have NBSP taken in account with Unicode character ?  
All the best from France

---

<div class="post-metadata">

**Author:** ![jgm](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/jgm/32/1360_2.png) [@jgm](https://talk.commonmark.org/u/jgm)\
**Post date:** [October 6, 2016, 9:54am UTC](https://talk.commonmark.org/t/native-support-for-unicode-no-break-space/2251/2 "2016-10-06T09:54:10Z")

</div>

Both reference parsers handle U+00A0 with no difficulty. Your question is really about the online dingus, I suppose, but I’d suggest you download one of the reference implementations and use it directly.

Note that you can also insert the character with `&#xA0;`.

---

<div class="post-metadata">

**Author:** ![Yannk](https://cdn.commonmark.org/letter_avatar_proxy/v2/letter/y/e480ec/32.png) [@Yannk](https://talk.commonmark.org/u/Yannk)\
**Post date:** [October 6, 2016, 12:52pm UTC](https://talk.commonmark.org/t/native-support-for-unicode-no-break-space/2251/3 "2016-10-06T12:52:30Z")

</div>

Thanks for your answer. I was speaking about offline tools. I have made a test, creating a simple markdown file with gedit, save it and with pandoc export it in epub (a simple command line, all default). The nbsp I have included with unicode Ctrl+Shift+0020 has not been taken in consideration in the resulting epub.  
Is there some indication to include some where in the file ? Or some text editors to prefer ?

---

<div class="post-metadata">

**Author:** ![Yannk](https://cdn.commonmark.org/letter_avatar_proxy/v2/letter/y/e480ec/32.png) [@Yannk](https://talk.commonmark.org/u/Yannk)\
**Post date:** [December 5, 2016, 8:34am UTC](https://talk.commonmark.org/t/native-support-for-unicode-no-break-space/2251/4 "2016-12-05T08:34:39Z")

</div>

Hello. I have made new tests, and have checked that the space I used were actually 0x00a0 and not 0x20  
I get a normal space in the resulting epub when I export through pandoc. Is there some tweaking/paramater I should make ?

---

<div class="post-metadata">

**Author:** ![lwmr](https://cdn.commonmark.org/letter_avatar_proxy/v2/letter/l/0ea827/32.png) [@lwmr](https://talk.commonmark.org/u/lwmr)\
**Post date:** [December 15, 2016, 10:45pm UTC](https://talk.commonmark.org/t/native-support-for-unicode-no-break-space/2251/5 "2016-12-15T22:45:39Z")

</div>

There are many ways to encode NBSP in HTML. Two of them are `<p>non-breaking space</p>` and `<p>non-breaking&nbsp;space</p>`.

There are plenty of ways to encode NBSP in Markdown too. The most common two are again `non-breaking space` and `non-breaking&nbsp;space`. Regardless of which Markdown representation you choose, the CommonMark reference implementation always chooses to convert it to `<p>non-breaking space</p>` in HTML.

That’s why you see `<p>non-breaking space</p>`, not `<p>non-breaking&nbsp;space</p>` in the “HTML” tab of the online dingus. [See it yourself](http://spec.commonmark.org/dingus/?text=non-breaking%26nbsp%3Bspace%0A%0Anon-breaking%C2%A0space).

Now try to copy `non-breaking space` from any **rendered** output. What you’ll get in your clipboard is `non-breaking` and `space` with the plain old 0x20 space between them. Even though what you copy actually contains NBSP, your browser replaces it with the plain old space on copying, for some unknown reason.

It’s a bug (or maybe a feature) which is present in both Firefox and Chromium. I couldn’t find any exact info on why this happens.

There’s this 10-year-old open bug in Mozilla’s Bugzilla: [https://bugzilla.mozilla.org/show\_bug.cgi?id=359303](https://bugzilla.mozilla.org/show_bug.cgi?id=359303).

---

<div class="post-metadata">

**Author:** ![lwmr](https://cdn.commonmark.org/letter_avatar_proxy/v2/letter/l/0ea827/32.png) [@lwmr](https://talk.commonmark.org/u/lwmr)\
**Post date:** [December 15, 2016, 10:53pm UTC](https://talk.commonmark.org/t/native-support-for-unicode-no-break-space/2251/6 "2016-12-15T22:53:07Z")

</div>

> [@Yannk](#):
>
> I get a normal space in the resulting epub

EPUB is an XML-based format. If you check for NBSP by copying and pasting, you may stumble upon the same bug I describe above. How do you check it?

---

<div class="post-metadata">

**Author:** ![lwmr](https://cdn.commonmark.org/letter_avatar_proxy/v2/letter/l/0ea827/32.png) [@lwmr](https://talk.commonmark.org/u/lwmr)\
**Post date:** [December 15, 2016, 11:02pm UTC](https://talk.commonmark.org/t/native-support-for-unicode-no-break-space/2251/7 "2016-12-15T23:02:21Z")

</div>

> [@lwmr](#):
>
> It’s a bug (or maybe a feature) which is present in both Firefox and Chromium. I couldn’t find any exact info on why this happens.

Maybe somebody should ask the Firefox and Chromium devs on their respective IRC channels. Definitely not me or not today. I’m done with investigating obscure software bugs for today.

---

<div class="post-metadata">

**Author:** ![Yannk](https://cdn.commonmark.org/letter_avatar_proxy/v2/letter/y/e480ec/32.png) [@Yannk](https://talk.commonmark.org/u/Yannk)\
**Post date:** [December 16, 2016, 10:13pm UTC](https://talk.commonmark.org/t/native-support-for-unicode-no-break-space/2251/8 "2016-12-16T22:13:56Z")

</div>

Thanks for your input. I will definitively look for more tests. Perhaps it is only a viewer problem and not export as you say.

---

<div class="post-metadata">

**Author:** ![lwmr](https://cdn.commonmark.org/letter_avatar_proxy/v2/letter/l/0ea827/32.png) [@lwmr](https://talk.commonmark.org/u/lwmr)\
**Post date:** [December 17, 2016, 6:11am UTC](https://talk.commonmark.org/t/native-support-for-unicode-no-break-space/2251/9 "2016-12-17T06:11:18Z")

</div>

> [@lwmr](#):
>
> Even though what you copy actually contains NBSP, your browser replaces it with the plain old space on copying, for some unknown reason.

To prove it, I created this even easier way to reproduce this behavior: [https://codepen.io/anon/pen/PbXeNx](https://codepen.io/anon/pen/PbXeNx).

> [@Yannk](#):
>
> I will definitively look for more tests.

Let us now when you find more. I’m especially interested why this weird behavior happens.

---

<div class="post-metadata">

**Author:** ![Yannk](https://cdn.commonmark.org/letter_avatar_proxy/v2/letter/y/e480ec/32.png) [@Yannk](https://talk.commonmark.org/u/Yannk)\
**Post date:** [January 4, 2017, 10:20am UTC](https://talk.commonmark.org/t/native-support-for-unicode-no-break-space/2251/10 "2017-01-04T10:20:31Z")

</div>

OK. So I have taken the opportunity during New Year Eve to update my system (Debian Sid) and I have taken the latest pandoc package from the pandoc website. Now I have exactly the behaviour you describe.  
The problem is that many writing softwares don’t show the nbsp ([Retext](https://github.com/retext-project) for instance) on preview (using some web tool like webkit) and, moreover, save the nbsp as normal space which is a problem on their own.  
Anyway that’s no longer a markdown issue for me, thanks a lot for your help 🙂
