I want to post ' ' with 4 spaces between the tick marks, but the markup languages removes them. I tried inline code but that didn't help. How can I do that without using the Code button?

Recommended Answers

All 9 Replies

Hmm ... strange that the markup language would remove them.

Test: ' ' Hmm ...

You're right. I forgot that inline code strips excessive whitespace. :( It's the HTML standard.

According to this html should display   as a space

Test: "    "

Test failed.

Therefore, DaniWeb-flavored Markdown currently does not allow any HTML. Both HTML tags and entities will not be parsed.

HUH? What were you trying to test?

I wanted to see if there was a work-around, but I guess not.

' '
backticked quote test myself, code block

'     '

If I wanted to fix this "bug", then on the server-side we could replace all spaces within inline code with  . However, I don't think I want to do that since it would go against the W3C's standard that inline code collapses whitespace.

How about if poster wants white space untouched then just use   but that would have to be an exception to your rule of no html. How is it done when Code ? Shouldn't inline code behave the same?

Inline code is generated by using the HTML tag <code></code>. According to the HTML standard, the code tag does not preserve whitespace.

Code blocks are generated by wrapping the code tags with preformatted text tags, which are used to preserve formatting and whitespace. Therefore, code blocks are generated using the HTML tag <pre><code>...</code></pre>, as explicitely recommended by Google.

One of the most important features of the Markdown language is its cleanness and cut-and-dry separation of context and formatting. Therefore, using &nbsp; for formatting/design reasons actually goes directly against both the W3C's guidelines for HTML 5 and proper SEO guidelines.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.