[GH-ISSUE #4931] [Bug] Markdown Italic Formatting Issue with Underscores #2196

Open
opened 2026-03-23 21:20:30 +00:00 by mirror · 1 comment
Owner

Originally created by @nchj on GitHub (Mar 18, 2024).
Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/4931

Bug Description

When typing text containing two underscores (_) in the project documentation or markdown files, the text is automatically formatted as italic, even when the intention is to display the underscores literally. This occurs for text patterns like X_Y,Y_Z, where the text between underscores is rendered in italic, which is a common markdown syntax. However, the current markdown renderer in the software behave wired when typing \ to eacepe the _

How to Reproduce

just type "X_Y,Y_Z" in appflowy, Y,YZ will become italic,
X_Y,Y_Z

type "X\_Y,Y\_Z" is work
work well

but if add more _ and _ in one line ,it is really wired behaviour,for example, i type this:
图片
app floyw will render like this
图片

the more \_ and _ you typed in a line, you will find the more strange the behaviour is

Expected Behavior

for the last example ,it should render like this
图片

Operating System

macos verntura

AppFlowy Version(s)

0.5.2

Screenshots

No response

Additional Context

No response

Originally created by @nchj on GitHub (Mar 18, 2024). Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/4931 ### Bug Description When typing text containing two underscores (`_`) in the project documentation or markdown files, the text is automatically formatted as italic, even when the intention is to display the underscores literally. This occurs for text patterns like `X_Y,Y_Z`, where the text between underscores is rendered in italic, which is a common markdown syntax. However, the current markdown renderer in the software behave wired when typing `\` to eacepe the `_` ### How to Reproduce just type "X_Y,Y_Z" in appflowy, Y,YZ will become italic, <img width="69" alt="X_Y,Y_Z" src="https://github.com/AppFlowy-IO/AppFlowy/assets/28175310/7fe3282d-1218-408b-9e1a-fb616639bf2f"> type "X\\_Y,Y\\_Z" is work <img width="123" alt="work well" src="https://github.com/AppFlowy-IO/AppFlowy/assets/28175310/1fb20abb-714d-4bcc-a9b6-b6ccd9001637"> but if add more _ and _ in one line ,it is really wired behaviour,for example, i type this: <img width="214" alt="图片" src="https://github.com/AppFlowy-IO/AppFlowy/assets/28175310/94e16a51-b234-405f-a435-252e51c62940"> app floyw will render like this <img width="137" alt="图片" src="https://github.com/AppFlowy-IO/AppFlowy/assets/28175310/08a4313f-09af-4872-b562-12b720ccf3e8"> the more `\_` and `_` you typed in a line, you will find the more strange the behaviour is ### Expected Behavior for the last example ,it should render like this <img width="151" alt="图片" src="https://github.com/AppFlowy-IO/AppFlowy/assets/28175310/89d7d090-5bc3-4542-bd32-b326a190c6ad"> ### Operating System macos verntura ### AppFlowy Version(s) 0.5.2 ### Screenshots _No response_ ### Additional Context _No response_
Author
Owner

@LucasXu0 commented on GitHub (Nov 21, 2025):

https://discord.com/channels/903549834160635914/903553722804748309/1441210846847172618

A suggestion: if the text before the underscore is not a whitespace, the automatic italics should be disabled.

<!-- gh-comment-id:3561563156 --> @LucasXu0 commented on GitHub (Nov 21, 2025): https://discord.com/channels/903549834160635914/903553722804748309/1441210846847172618 A suggestion: if the text before the underscore is not a whitespace, the automatic italics should be disabled.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#2196
No description provided.