Skip to content

Conversation

dustinbyrne
Copy link
Contributor

This PR includes two fixes:

  1. Indented Code Block Parsing: Updates the markdown parser in Thread.onToken to correctly identify code fences (```) and file comments (<!-- file: -->) even when they are indented (e.g., within lists). This ensures the frontend receives proper metadata for syntax highlighting and other features. Resolves Code block parsing does not expect whitespace before code fences #2281
  2. OpenAI Model Filtering: Excludes image-generation models (like dall-e and others containing image) from the list fetched from OpenAI, as they are not relevant for Navie's text-based interactions. Also refactors the exclusion logic slightly for clarity.

This allows the frontend to receive metadata about the codeblock
instead of relying on default markdown styling
@dustinbyrne
Copy link
Contributor Author

dustinbyrne commented Apr 28, 2025

Without the associated front end fix, indented code blocks will render like so:
image

@dustinbyrne
Copy link
Contributor Author

dustinbyrne commented Apr 28, 2025

With the frontend fix:
image

@kgilpin
Copy link
Contributor

kgilpin commented May 13, 2025

@dividedmind this is coded and has tests. Should it be merged?

@dividedmind
Copy link
Collaborator

@dividedmind this is coded and has tests. Should it be merged?

I dunno, looks ok to me, but it's still marked as draft.

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.

Code block parsing does not expect whitespace before code fences
3 participants