Open-Assistant icon indicating copy to clipboard operation
Open-Assistant copied to clipboard

Comments in code are interpreted as titles when not code is not marked as markdown

Open GuilleHoardings opened this issue 2 years ago • 5 comments

Now that the messages interpret markdown, when there's text in a programming language like python that uses # for comments and the code was not marked as a code block, the line is interpreted as a title and the appearance is broken. Example:

image

I don't know what would be the solution. Maybe, adding a button to disable markdown on a specific message?

GuilleHoardings avatar Feb 18 '23 13:02 GuilleHoardings

That's invalid syntax if you want to render code. You need to wrap it in ``` Example

# comment
print("hello word")

notmd avatar Feb 18 '23 18:02 notmd

I think that the problem is that, as Markdown was not supported initially and there were no clear guidelines, some people didn't format the code correctly and now their messages look different to when they wrote it. I don't know if, from a data quality point of view, having code without Markdown will cause problems.

Anyway, maybe it's not worth addressing this issue.

GuilleHoardings avatar Feb 18 '23 21:02 GuilleHoardings

It may be worth looking through the data for # comments and fixing those. I don't think we lose much by doing that do we?

bitplane avatar Feb 18 '23 23:02 bitplane

Do you mean manually, or having an automated process? Manually seems like too much work, and automatically, seems difficult to find the start and end of the code.

GuilleHoardings avatar Feb 19 '23 00:02 GuilleHoardings

I guess looking through the data when it's out and writing something that will identify how big the issue is.

Another option would be to add "media-type" to the metadata and add "text/markdown" to recent ones and "text/plain" to older ones before the markdown change that have headings in them, and leave the rest ambiguous.

bitplane avatar Feb 19 '23 05:02 bitplane