#16321 closed defect (fixed)
[patch] [cla] dojox.highlight.languages.python does not properly handle raw string literals
Reported by: | mzipay | Owned by: | dylan |
---|---|---|---|
Priority: | undecided | Milestone: | 1.7.9 |
Component: | Dojox | Version: | 1.8.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
The dojox.highlight.languages.python modes only recognize r'string' and r"string" literals, which causes highlighting to fail for modules that use rstring or r"""string""" (commonly used for doctest-style inline tests).
I am using the following monkey-patch to work around this issue until it is resolved (note this does not address raw Unicode string literals):
python.modes.splice(0, 0,
{
className: 'string', begin: 'r\'\'\, end: '\'\'\, relevance: 10
}, {
className: 'string', begin: 'r"""', end: '"""', relevance: 10
});
Also attaching a patch.
Attachments (1)
Change History (12)
Changed 8 years ago by
Attachment: | python.js_patch.txt added |
---|
comment:1 Changed 8 years ago by
Component: | General → Dojox |
---|---|
Owner: | set to dante |
Status: | new → assigned |
Summary: | dojox.highlight.languages.python does not properly handle raw string literals → [patch] dojox.highlight.languages.python does not properly handle raw string literals |
Ostensibly Peter owns this project.
mzipay - can you submit a CLA?
comment:3 Changed 8 years ago by
Summary: | [patch] dojox.highlight.languages.python does not properly handle raw string literals → [patch] [cla] dojox.highlight.languages.python does not properly handle raw string literals |
---|
comment:4 Changed 8 years ago by
Owner: | changed from dante to Kitson Kelly |
---|
comment:5 Changed 6 years ago by
Milestone: | tbd → 1.11 |
---|---|
Owner: | changed from Kitson Kelly to dylan |
comment:6 Changed 6 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:11 Changed 6 years ago by
Milestone: | 1.11 → 1.7.9 |
---|
Thanks for the patch, accepted and included back through 1.7.x.
Patch to dojox/highlight/languages/python.js to recognize rstring and r"""string""" literals