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: escape curly brakets for markdown #81

Merged
merged 1 commit into from
Jul 22, 2024

Conversation

darkweaver87
Copy link
Contributor

markdownRenderFieldDoc should espace { and }.

Signed-off-by: Rémi BUISSON <remi-buisson@orange.fr>
@thbkrkr thbkrkr added the bug Something isn't working label May 14, 2024
@@ -145,6 +145,10 @@ func (m *MarkdownRenderer) RenderFieldDoc(text string) string {
// so that including | in a comment does not result in wonky tables.
out := strings.ReplaceAll(text, "|", "\\|")

// Escape the curly bracket character.
out = strings.ReplaceAll(out, "{", "\\{")
out = strings.ReplaceAll(out, "}", "\\}")
Copy link
Contributor

Choose a reason for hiding this comment

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

We do the same thing in RenderDefault but I think it's okay to duplicate. We will see in the future if we share some of the chars to be escaped between the two functions.

@thbkrkr thbkrkr merged commit 1c93a29 into elastic:master Jul 22, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants