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

Multiline formatting of code block is lost for several (non-supported?) languages #107

Open
GrAndAG opened this issue May 31, 2024 · 2 comments

Comments

@GrAndAG
Copy link

GrAndAG commented May 31, 2024

For example, the assembly/nasm/x86 code block lost its formatting and shown as single line.

image

The corresponding JSON of the response:

    {
      "role": "assistant",
      "content": "Here's a simple \"Hello, World!\" program in x86 assembly language for the NASM (Netwide Assembler) assembler:\n\n```nasm\nsection .data\n    msg db 'Hello, World!', 0\n\nsection .text\n    global _start\n\n_start:\n    ; Print the message\n    mov eax, 4      ; system call number for write\n    mov ebx, 1      ; file descriptor (stdout)\n    mov ecx, msg    ; address of string to write\n    mov edx, len    ; length of string\n    int 0x80        ; invoke operating system\n\n    ; Exit the program\n    mov eax, 1      ; system call number for exit\n    xor ebx, ebx    ; return code (0)\n    int 0x80        ; invoke operating system\n\nsection .data\nlen equ $-msg    ; calculate length of string\n```\n\n...."
    },

Another examples:

image
image

And again, a lot of \n in original responce are lost in code block.

@GrAndAG GrAndAG changed the title Code multiline formatting is lost for several (non-supported?) languages Multiline formatting of code block is lost for several (non-supported?) languages May 31, 2024
@Shackless
Copy link
Contributor

Shackless commented May 31, 2024

Yeah that's because our syntax highlighter highlight.js doesn't support these languages be default. Maybe with a plugin.

@GrAndAG
Copy link
Author

GrAndAG commented Jun 3, 2024

It's ok if a language is not supported and rendered without syntax highlighting. But anyway it has to be displayed "as is" at least (preserve multiline formatting).

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

No branches or pull requests

2 participants