Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add escape characters #452

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

u4aew
Copy link

@u4aew u4aew commented Oct 31, 2024

Add escape characters "_"

issue 387

@gravity-ui-bot
Copy link
Contributor

Preview is ready.

@@ -301,7 +301,7 @@ export class MarkdownSerializerState {
// content. If `startOfLine` is true, also escape characters that
// have special meaning only at the start of the line.
esc(str, startOfLine) {
const escRegexp = this.options?.commonEscape || /[`\^+*\\\|~\[\]\{\}<>\$]/g;
const escRegexp = this.options?.commonEscape || /[`\^+*\\\|~\[\]\{\}<>\$_]/g;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add tests for this case to markdown-editor/src/core/markdown/Markdown.test.ts. What do you think?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, okay, I'll add tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants