Convert html   to ascii space when adding code block

Use case or problem

When pasting a non-HTML code snippet into a markdown non-HTML code block, it would be VERY helpful if Obsidian automatically converted   to an ascii space in the block.

The problem comes in when you try to copy that code block into a program such as Microsoft SQL Server Management Studio, it pastes the   into the query window.

How to repro - open a browser page that contains SQL that you know contains  . Select that SQL and Ctrl-C to copy that SQL code block. Open Obsidian and add a new page, start a SQL code block, move cursor into that code block. Press Ctrl-V to paste the code from clipboard into the SQL code block.

Press Ctrl-V to change the page to view mode, click ‘Copy’ on the code block.
Toggle back to SSMS and open a new query window. Then press Ctrl-V to paste the code.

Expected: The   should not be in the pasted query.
Actual: The   shows in the pasted query.

Proposed solution

Simply add an Options switch to automatically convert   to space when pasting into a non-HTML code block.

Current workaround (optional)

Work around is to paste the copied code block into notepad and manually replace the   with space BEFORE you paste it into your non-HTML code block in Obsidian. That way when you copy it from Obsidian, it will not contain the  

Related feature requests (optional)

None

1 Like