Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Characters " " inside Code Block instead of space #669

Open
yoric-m opened this issue Mar 6, 2019 · 6 comments
Open

Characters " " inside Code Block instead of space #669

yoric-m opened this issue Mar 6, 2019 · 6 comments
Assignees
Labels

Comments

@yoric-m
Copy link

yoric-m commented Mar 6, 2019

I'm a new Showdown user, experimenting the CLI tool to convert my markdown pages into static html files for my blog. I'm very happy with it so far.
However, I just stumbled upon a Gotcha while copy/pasting my directory structure inside a block of code (using the triple backticks).

Does someone knows why the rendering with Showdown is like this:

tree
├── folder1
│   └── a.txt
└── folder2
    └── b.txt

While it is like this in other markdown to html converter (and also here on Github):

tree
├── folder1
│   └── a.txt
└── folder2
    └── b.txt

It looks like Showdown is putting &amp;nbsp; inside the <pre><code> tag instead of &nbsp; to render the space character.

I'm really not sure if I'm misusing it or if it's a bug. Does anyone one has an idea about it?

@yoric-m yoric-m changed the title Characters "&nbsp;" get inserted inside Code Block Characters "&nbsp;" inside Code Block instead of space Mar 6, 2019
@tivie tivie self-assigned this Mar 16, 2019
@tivie tivie added the bug label Mar 16, 2019
@tivie
Copy link
Member

tivie commented Mar 16, 2019

Bug confirmed.

The input text has non-breaking spaces inside the code block which get converted to the correspondent html entity &nbsp;. However, then the code block is encoded again, changing & to &amp; resulting in that weird behavior.

@djlxiaoshi
Copy link

i met the same problem

@gengue
Copy link

gengue commented Sep 3, 2021

Same here, I got this: ¨NBSP;

@Stonks3141
Copy link

Same here, => { becomes =&gt; { in <pre><code> and <code> blocks. Inspecting reveals =&amp;gt {.

@tivie
Copy link
Member

tivie commented Apr 28, 2022

we are working on a fix for this (and other related issues).

tivie added a commit that referenced this issue May 9, 2022
@tivie
Copy link
Member

tivie commented May 9, 2022

should be fixed. Will be merged in develop soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants