Skip to main content
Associate III
July 15, 2026
Question

Code block does not handle tripple quotes for Python

  • July 15, 2026
  • 2 replies
  • 56 views

The code block rendering does not correctly color comments / multi-line strings with tripple quotes in Python:

Screenshot of the code block rendering Python code with incorrect formatting for tripple-quote strings.

Lines 2,3 and 9 should have green text as well.

2 replies

Andrew Neil
Super User
July 15, 2026

Does using single quotes make any difference?

'''
All the patches that are needed for sane version control.
'''
from pathlib import Path


def patch_application_vcxproj():
''' Converts '/>' to ' />' in Application.vcxproj.
'''
p = Path('./simulator/msvs/Application.vcxproj')

new = ''
with p.open('r') as f:
original = f.read()
new = original.replace('/>', ' />')
# remove last newline
new = new[:-1]

 

EDIT: No, it doesn’t!

And it has the same WYSINWYG* issues as C:

 

* What You See Is Not What You Get

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Zita LASZLOFI
ST Community Manager
July 24, 2026

Hi ​@Aron Hoogeveen and ​@Andrew Neil 
Thank you for sharing this feedback and apologies for the late reply here. I’m adding this to the improvement suggestions regarding writing code. 

Best, 
Zita

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.