Non-breaking space turn into code ONLY in LP

Steps to reproduce

Type or copy/paste non-breaking space and type paragraph after that.
Note : Non-breaking space on Windows is alt+255 ; on Mac it is alt+space

Expected result

Tbh, I don’t know what to expect : code in reading mode? Normal text in live preview?
Normally non breaking space mustn’t turn Block into code

Actual result

In Live Preview, text turn into code, and get the class In the DOM you can notice the  

BUT, the text, in reading mode is normal with the good number of non-breaking space.



  • Operating system: Windows 11
  • Debug info:
	Obsidian version: v0.15.9
	Installer version: v0.14.15
	Operating system: Windows 10 Education 10.0.22622
	Login status: logged in
	Catalyst license: insider
	Insider build toggle: on
	Live preview: on
	Legacy editor: off
	Base theme: light
	Community theme: BRAT-ceciliamay----obsidianmd-theme-primary
	Snippets enabled: 38
	Restricted mode: off
	Plugins installed: 81
	Plugins enabled: 74
		1: Quick Explorer v0.1.38
		2: Collapse All v1.5.2
		3: QuickAdd v0.5.5
		4: MetaEdit v1.7.2
		5: Folder Focus Mode v0.9.5-0
		6: Icon Shortcodes v0.9.6
		7: Waypoint v1.3.0
		8: Hider v1.1.1
		9: Natural Language Dates v0.6.1
		10: Clear Unused Images v1.0.6
		11: Smart Typography v1.0.18
		12: Dynamic Highlights v0.3.1
		13: Banners v1.3.3
		14: List Callouts v1.0.5
		15: Icon Folder v1.3.31
		16: File Hider v1.1.0
		17: LanguageTool Integration v0.3.0
		18: Auto Link Title v1.2.5
		19: Homepage v2.2.1
		20: Linter v1.3.7
		21: Markdown Table Editor v0.3.1
		22: Paste image rename v1.5.0
		23: Admonition v9.0.3
		24: Dataview v0.5.41
		25: Metadata Menu v0.1.9
		26: Advanced Tables v0.17.3
		27: Simple Embeds v1.12.0
		28: Tidy Footnotes v0.1.1
		29: Link Favicons v1.7.4
		30: Force note view mode v1.1.1
		31: Commander v0.1.0
		32: Dictionary v2.21.1
		33: Supercharged Links v0.8.0
		34: Footnote Shortcut v0.0.9
		35: Style Settings v0.4.10
		36: CodeMirror Options v0.9.5
		37: Snippet Downloader v1.4.4
		38: Obsidian Note Sharing v0.1.0
		39: Settings Search v1.2.0
		40: Table Generator v1.1.1
		41: Format Hotkeys v0.1.7
		42: Excalidraw v1.7.12
		43: Folder Note Core v1.3.5
		44: Smarter Markdown Hotkeys v1.16.2
		45: Editor Syntax Highlight v0.1.3
		46: Customizable Menu v2.2.0
		47: AidenLx's Folder Note v0.16.4
		48: Auto Card Link v1.1.1
		49: Obsidian42 - BRAT v0.6.34
		50: AidenLx's Folder Note - folderv component v1.0.0
		51: Templater v1.12.0
		52: Bartender v0.5.7
		53: Github Publisher v3.15.0
		54: Copy Image and URL context menu v1.3.6
		55: No dupe leaves v0.0.5
		56: DB Folder v2.1.2
		57: Hotkey Helper v0.3.13
		58: Markdown Attributes v1.1.1
		59: MySnippets v1.2.1
		60: Another Quick Switcher v5.4.1
		61: Contextual Typography v2.2.4
		62: Group Snippets v1.4.0
		63: Hover Editor v0.11.4
		64: Image Toolkit v1.3.1
		65: Kanban v1.3.15
		66: Metacopy v1.3.0
		67: Sortable v0.2.6
		68: Trim Whitespace v0.2.2
		69: Better footnote v1.0.1
		70: Copy as HTML v1.0.5
		71: CM6 Attributees v0.0.5
		72: Local File Interface v0.1.0
		73: Meta Bind Plugin v0.2.0
		74: Wrap with shortcuts v1.1.0

	Custom theme: for cosmetic issues, please first try updating your theme to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets.
	Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.

Additional information

  • Using tabulation, code will get the code in the two mode (LP and reading mode). This bug only happened with non-breaking space.
  • I can repro this behavior in the sandbox vault.
  • it happend on IOS, ipados and windows

For me 4+ spaces (breaking or non breaking) turn into codeblock.
Both in LP and reader and also here

Well, on IPADOS (with external keyboard) I can repro this behavior :

I used alt+space to create the nsbp;

I don’t think that 4 nbsp; must create an indented code bloc…

Some attemp in python markdown give me :

  • Removing of every non breaking space (give me a simple <p>...</p>
  • 4 hard-coded &nbsp; continue to get me a paragraph
  • Four normal space turn into code (following markdown specification)
In [3]: text='    lorem ipsum'

In [4]: mk.markdown(text)
Out[4]: '<p>lorem ipsum</p>'

In [5]: text
Out[5]: '\xa0\xa0\xa0\xa0lorem ipsum'

In [6]: mk.markdown('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LLorem ipsum')
Out[6]: '<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LLorem ipsum</p>'

In [12]: mk.markdown('    LLorem ipsum')
Out[12]: '<pre><code>LLorem ipsum\n</code></pre>'

You are entering &nbsp. That’s html not unicode.
Regardless, I don’t know what python markdown follows. We follow commonmark.
You can copy paste the text from your first post there and see what happens.

It’s is possible that my copy and paste change the non breaking character with normal space.

As I said, to fully enter a non breaking space (without hardcoding with &nsbp;) you must use alt+255 (windows) or alt+space (Mac)

If you use them, you will get the same behavior of me, that appear on windows ; ipad os and ios and on sandbox vault

Also, emsp; do the same problem :

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque congue varius lorem non eleifend. Suspendisse tincidunt ante ac purus ornare, nec elementum erat mattis. Nullam imperdiet enim nec auctor tempor. Etiam vitae purus ullamcorper, dictum dui nec, elementum ex. Curabitur varius augue ut eros egestas, vel vehicula velit malesuada. Donec vitae venenatis massa. Etiam felis purus, finibus et quam feugiat, aliquam varius tortor. In hac habitasse platea dictumst. Donec pharetra posuere ligula vel pretium. Suspendisse augue enim, elementum ac quam sed, cursus rutrum libero. Morbi imperdiet id urna quis bibendum.

Edit : it seems that copy and paste the test text change the non breaking space into normal space

Ok, thanks I managed to reproduce.

1 Like