Missing Syntax Highlighting While Rendering Code Blocks Generated By Coda AI


Hey there! As a fellow Coda enthusiast, I wanted to share an issue I encountered while using Coda AI to generate code blocks. It seems that there’s a missing syntax highlighting feature specifically for markdown code. Let me explain further: when I try to create a code block by using three backticks and specifying the language, the editor doesn’t recognize the language and simply treats it as plain text within the code block.

Steps to Reproduce:

  1. Insert a code block using three backticks ` and indicate the language, such as “python”.
  2. Type some code inside the code block, like HelloWorld("print").

Current Behavior:

The code block is rendered without syntax highlighting, appearing like this with the language at the beginning:


A live example: https://nbviewer.org/github/wiseaidev/goodbye-world/blob/main/books/Rust.pdf

Expected Behavior:

I expected the code block to be rendered with syntax highlighting, so that it would look like this:


Additional Notes:

The missing syntax highlighting feature makes it difficult to read and understand the code within the generated code block. Syntax highlighting is an essential functionality that helps improve code readability and comprehension. It would greatly enhance the overall user experience if this issue could be addressed and syntax highlighting support for markdown code blocks could be implemented. Thanks for your amazin’ work!

Hi @Mahmoud :blush: !

Syntax Highlight in code block is currently in beta so it’s not available yet :blush:

1 Like

:wave: Thanks for sharing this request! We’ve been working on improving Coda’s code block and I’m happy to share that we’ve now launched new code blocks that support syntax formatting for nearly 100 languages!

You can try it out by typing /code block in your doc — let us know what you think!

1 Like

Thanks for the awesome new code block! It’s absolutely fire, and I’m loving it!

Edit: So, here’s the deal – Coda docs seem to have a little trouble picking the correct code syntax generated by Coda AI. Notice the term ‘rust’ at the beginning of the code block, which shouldn’t be there:
The issue lies in Coda docs rendering the code instantly without considering the term after the three backticks ```rust ← this term is not considered while rendering the code block markdown text, as highlighted in this bug report.

Thanks so much for this example! Let me send over to our eng team to take a look :slight_smile:

Here’s a vote for SQL syntax to be supported.