Code block start sequence (```) is recognized even if it is immediately followed by text, but not recognized as end sequence in the same scenario
What's happening?
Code block start sequence (```) is recognized if it is immediately followed by text, but not recognized as end sequence in the same scenario.
Here is an example output I get from Opus 4.6 to a question about image format on OpenAI API:
**Content block structure:** Images are embedded as content blocks within a message's `content` array (which must be a list, not a plain string, when images are included). The content block type is `ChatCompletionContentPartImage`, with fields `image_url` and `type`. The structure is:
```json
{
"type": "image_url",
"image_url": {
"url": "data:image/png;base64,<BASE64_DATA>",
"detail": "high"
}
}
```The base64 image data is passed via a data URL format: `"data:image/jpeg;base64,<your_image_data>"`.
"" in "json" is recognized as code block start, but is not recognized in "```The base64" as code block end.
It would be preferable if either both cases are recognized as code block start/end, or neither is recognized as code block start/end, unless there is a compelling argument as to why one is recognized and the other is not.
Right now answers like this are not easy to read in Big-AGI UI due to non-code sections ending up being presented as code.
Where does this happen?
Big-AGI Pro (big-agi.com)
Impact on your workflow
Low - Minor inconvenience
Environment (if applicable)
No response
Additional context
No response
Source: enricoros/big-AGI