#Incorrect code formatting and syntax highlighting in GPT project interface (o3-mini)

1 messages · Page 1 of 1 (latest)

ivory cedarBOT
#

Reported by @worldly urchin

Bug Report: Incorrect code formatting and syntax highlighting in GPT project interface (o3-mini)
`Steps to Reproduce`
  1. Open or create a new project using GPT's o3-mini environment.
  2. Paste or auto-generate any code snippet (HTML, CSS, JavaScript, Python, JSON, etc.).
  3. Observe that the code snippet immediately appears unformatted, without syntax highlighting, indentation, or proper spacing.
`Expected Result`

The code snippets should maintain their formatting, indentation, proper syntax highlighting, and line breaks, making the code clear, readable, and easily manageable.

`Actual Result`

All code snippets inserted or generated within GPT's o3-mini environment appear as a single, unformatted continuous line without syntax highlighting, indentation, or spacing. This significantly impacts readability and usability.

`Environment`

Windows 11(24H2), Chrome 134.0.6998.88

#
Additional Information

Please provide relevant details to help resolve the issue, such as:

  • ChatGPT Shared Link (if applicable).
  • Screenshots or videos demonstrating the problem.

-# ➜ Need to contact support? Visit the OpenAI Help Center.

worldly urchin
finite panther
#

Try ctrl-Shift-V

worldly urchin
finite panther
#

I noted what works for me with this and other interfaces. This can happen when the text comes from a web page or other UI rather than an IDE. It can happen when the source only has linefeeds, your UI renders that code as CRLF, but on copy/paste it's still only LF, which gets processed differently depending on where you paste it. Your copy bigger doesn't auto convert LF/CRLF.

Your report changed. I'd have questions:

  • What exactly does the source text look like in the source environment when you copy it?
  • What exactly does the text look like in the input box when you paste it?
  • What exactly is the source?
  • Have you tried copy/pasting from that source into a plain text editor like Notepad, then copy/passing from there to the input prompt? There IS a difference.
  • Do other models behave differently? If so, please post a screenshot.
  • Are you saying you have formatted code that you paste into a prompt and it's changed when the UI displays the prompt before its response?
  • You're saying it's not displaying syntax highlighting. Are you pasting in highlighted text? This points back to my point that visual formatting isn't copy/pasted. The code that is doing the highlighting may be pasted depending on how the text was copied.
    But line breaks should be preserved with a ctrl+Shift+V.

Another option is to be explicit that you're working with code. Use markdown and surround the text in triple backticks. This tells the model that the text is formatted

If you want the text formatted, ask for that. Maybe o3 reasons that if you didn't ask for something then it won't deliver something special - consider that a feature, not a bug.

  • You said this happens with Auto-generated text. From where?

Accept the experience and suggestions or not. But consider and try them.

worldly urchin
#

I tried it again and compared. If it's a short text prompt, it works correctly, but if I send a large block of code and ask a question, it starts doing its own thing again. Here's a screenshot.

#

I gave a simple prompt "write code site html,css test" and surprisingly the formatting works great.

#

But here it's not a problem with the browser or the application; it's a bug in the chatcgpt.com code itself, and bugs or incomplete development don't really surprise me lately when I write a huge prompt.