Skip to main content
Associate II
July 15, 2026
Question

Code block does not handle tripple quotes for Python

  • July 15, 2026
  • 1 reply
  • 9 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.

1 reply

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.