# Automatically paste as plaintext when the cursor is inside a code block

**URL:** <https://forum.obsidian.md/t/automatically-paste-as-plaintext-when-the-cursor-is-inside-a-code-block/16146>\
**Category:** Feature requests\
**Tags:** ui-ux\
**Created:** [April 8, 2021, 5:04pm UTC](https://forum.obsidian.md/t/automatically-paste-as-plaintext-when-the-cursor-is-inside-a-code-block/16146 "2021-04-08T17:04:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fcy](https://forum.obsidian.md/user_avatar/forum.obsidian.md/fcy/32/19716_2.png) [@fcy](https://forum.obsidian.md/u/fcy)\
**Post date:** [April 8, 2021, 5:04pm UTC](https://forum.obsidian.md/t/automatically-paste-as-plaintext-when-the-cursor-is-inside-a-code-block/16146/1 "2021-04-08T17:04:04Z")

</div>

### Use case or problem

When copying and pasting text that goes inside code blocks they should be pasted as plaintext by default, I can’t think of a reason where converting to markup inside a code block is the desired outcome or even if it is even common. That might be my bias flying high, so correct me if that is a wrong assumption.

### Proposed solution

I know we have context menu and shortcuts to paste as text, but doing the right thing™ automatically is a better experience. If the cursor is inside a code block pasting should automatically paste as plaintext.

Is this the end of the world? No, but if my assumption is correct - that inside code block we always want plaintext - it is just much nicer to use.

### Current workaround (optional)

Use the shortcut or context menu after you’ve already pasted and Obsidian did the wrong thing by inserting a bunch of markups inside the code block.

### Related feature requests (optional)

> [@Add "paste as plaintext" to the right-click editor context menu](https://forum.obsidian.md/t/add-paste-as-plaintext-to-the-right-click-editor-context-menu/10469):
>
> Hotkeys are all the rage, but sometimes I’m doing stuff with a mouse, and it’s faster to just continue doing stuff with the mouse for me. It would be amazing if, in addition to the Select All request [here](https://forum.obsidian.md/t/add-select-all-to-right-click-editor-context-menu/9594), there were a “paste as plain text” option because boy howdy do I not need all of the links from Wikipedia when I’m trying to paste in a paragraph of notes, and pasting into Notepad++ first is an unpleasant workaround when I can’t remember the hotkey or accidentally overwrote it with another p…

> [@Make optional - Turn on/off paste that converts HTML content to Markdown links](https://forum.obsidian.md/t/make-optional-turn-on-off-paste-that-converts-html-content-to-markdown-links/10096/2):
>
> i agree… i copied a few links and ha to clean them a lot. i hate when i copy some text and editors bring all their styles, too. usually there is be an option, a very simple cmd+option+shift+V to paste without any formatting

---

<div class="post-metadata">

**Author:** ![HornetHades](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/h/8edcca/32.png) [@HornetHades](https://forum.obsidian.md/u/HornetHades)\
**Post date:** [June 8, 2021, 2:40am UTC](https://forum.obsidian.md/t/automatically-paste-as-plaintext-when-the-cursor-is-inside-a-code-block/16146/2 "2021-06-08T02:40:09Z")

</div>

+1, I think this should be the default behaviour. If the text inside a codeblock is rendered as-is, then there is no reason to escape underscores.
