Share via

Bug: Notepad escapes underscore and backslash characters

Richard Sutch 0 Reputation points
2026-06-10T14:07:44.7533333+00:00

I've noticed this bug with my Notepad on windows:

  1. write some text including underscores e.g. "this is an_example"
  2. don't save the file, but close Notepad
  3. reopen Notepad
  4. the text is now displayed as "this is an_example"

If I repeat the steps again, it becomes "this is an\_example" - it appears each backslash is being escaped as well as each underscore.

I would raise this via the Feedback hub but I don't have it installed on my machine, I assume due to company policy.

Windows for business | Windows 365 Enterprise
0 comments No comments

1 answer

Sort by: Most helpful
  1. Marcin Policht 92,045 Reputation points MVP Volunteer Moderator
    2026-06-10T14:37:28.4266667+00:00

    AFAIK, this behavior is tied to the new Markdown features introduced to Windows 11 Notepad. Microsoft redesigned the application from a legacy plain-text utility into a modern editor capable of handling rich text formatting, headers, italics, and markdown files to fill the gap left by the discontinuation of WordPad.

    In standard Markdown syntax, underscores are markup characters used to generate italics or bold formatting. Because the modern Windows 11 Notepad now natively parses Markdown, its backend engine scans the text field for these characters. When the automatic Session Restore feature kicks in to save your progress, the application's underlying save mechanism assumes the underscore is a Markdown formatting command. To prevent the text from accidentally italicizing, the engine applies a backslash to escape it, changing your typed underscore into an escaped format.

    If you want to prevent this behavior without turning off your session cache, you should be able to toggle your document display settings. You can do this by clicking the Formatted or Syntax view toggle button located in the status bar, or by navigating to the View menu and adjusting the Markdown settings. Disabling rich text formatting in the Notepad settings menu should also restore the traditional plain-text saving behavior.


    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.