Why is this Text Centered?

I pasted some centered text from Grammarly into Obsidian, and it appears like this:

It’s centered. I didn’t expect it to be centered. But here’s the thing I can’t figure out…why is it centered?

This is what it looks like in edit mode:

Looks the same in source mode and live preview. The first line appears to be 24 spaces indented, but when I try to type in the spaces manually or use Tab for another paragraph, I can’t seem to reproduce the centering. Only if I paste it again can I achieve this centering.

There are no HTML tags involved, either. And in edit mode, the paragraphs can be collapsed.

It’s pretty cool that the centering format was preserved, but does anyone know what markdown syntax it’s using? How is it centered?

Try pasting centered text into Obsidian from a Grammarly document and you’ll see what I mean.

If you find the same thing in justified, let me know. :wink:

Hi @Bluemoondragon07

Even though they look like spaces they are probably Nonbreaking Spaces which is a different character so Obsidian doesn’t treat them like normal spaces.

  1. Try this, copy the code below into a text file
Hi
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hello
  1. name the text file “nbsp.html” or anthing else that ends in an extension .html
  2. open it in your browser. It should look like this in the web browser:

image

  1. copy from the browser to an obsidian note

the &nbsp; is how nonbreaking spaces are represented in HTML.

1 Like

Interesting. Pasting from the HTML does have the spaces render. I suppose that’s what it is!

Hey, now all I have to do to “center” text without HTML tags is to paste a bunch of these! Thanks for your help!

1 Like

You could save some time and strategically deploy them next time :stuck_out_tongue_closed_eyes:

  ← one space
  ← two spaces
  ← four spaces

&nbsp; <- one space 
&ensp; <- two spaces 
&emsp; <- four spaces 
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.