I want to write multiple spaces in code say
but I want to do this in code block ``. But in this case spaces are merged into one. I found this question but there is no solution... Maybe now somebody knows how to do this?
Looks like the hack suggested in the answer to the question you referring to no longer works, neither in post body nor in comments. (
with `` multiple `` `` spaces)
The backticks are not exactly code blocks.. they won't highlight the code inside them they're used more to "escape" tags so they appear in the post or to distinguish code parts written as part of the sentence.
You can write multiple spaces as part of a paragraph using
- it wil be parsed as a single space.
However when part of
backtick code it's not parsed.
You also have the
<pre></pre> tags, and whatever written between them will be indeed preserved as-is, for example:
However this can't be inline, even
if it's part of existing paragraph(see the source) it will be parsed into its own line.
Although you can use
at no. of times you wish and most of users do it. But it results in only one space at a time and for more spacing we've to use it no. of times i.e
..... (example facing such condition while posting this answer).
So,I am here discussing about three more entity reference that can be used.
Results in one character space; e.g. A B
Results in two character space; e.g. A B
Results in four character space; e.g. A B
In other words, the character width of them are:
= 1 x
= 2 x
= 2 x
= 4 x
So, as per requirement, we can use
For more information and character entity, visit Character entity references in HTML.
Hope this helps.
To type spaces at a random place, I use two different methods:
for each space, use a
You can use the real unbreakable space :
ALT+0160 like a boss.
Note that the the block itself can't start or end with a space:
is in fact
` . .` `. . ` `. .`
You need to use:
non-breaking space: ' '   em space: ' '   en space: ' '   thin space: ' '
<p>I will display  </p> <p>I will display  </p>
EN QUAD space example
<p>I will display  tt</p> <p>I will display  tt</p>
<p>I will display  tt</p> <p>I will display  tt</p>
Char Dec Hex Entity Name 8192 2000 EN QUAD 8193 2001 EM QUAD 8194 2002   EN SPACE 8195 2003   EM SPACE 8196 2004 THREE-PER-EM SPACE 8197 2005 FOUR-PER-EM SPACE 8198 2006 SIX-PER-EM SPACE 8199 2007 FIGURE SPACE 8200 2008 PUNCTUATION SPACE 8201 2009   THIN SPACE 8202 200A HAIR SPACE 8203 200B ZERO WIDTH SPACE
Basically you can replace 4 space with