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

Server front-end: do not apply Markdown formatting in code sections #6850

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

mgroeber9110
Copy link
Contributor

This modifies the rules for "Markdownish" formatting in the server's front-end to only replace formatting characters (like '_' and '*') and headings outside of code sections.

This keeps the formatter from messing up Python comments (# comment) and function names with underscores in code examples (my_example_function()).

The idea of the regex follows the accepted answer here: https://stackoverflow.com/questions/6462578/regex-to-match-all-instances-not-inside-quotes - only perform the replacement if it is followed by an even number of backquotes. This is still not perfect for truncated or invalid Markdown, and it only applies the correct formatting once the code section is closed, but at least it fixes some straightforward cases of code rendering.

@mgroeber9110 mgroeber9110 changed the title Server: do not apply Markdown formatting in code sections Server front-end: do not apply Markdown formatting in code sections Apr 23, 2024
@ggerganov ggerganov merged commit 3fe847b into ggml-org:master Apr 24, 2024
24 checks passed
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.

2 participants