Opened 7 years ago

Closed 4 years ago

Last modified 4 years ago

#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)

python.js_patch.txt (942 bytes) - added by mzipay 7 years ago.
Patch to dojox/highlight/languages/python.js to recognize rstring and r"""string""" literals

Download all attachments as: .zip

Change History (12)

Changed 7 years ago by mzipay

Attachment: python.js_patch.txt added

Patch to dojox/highlight/languages/python.js to recognize rstring and r"""string""" literals

comment:1 Changed 7 years ago by bill

Component: GeneralDojox
Owner: set to dante
Status: newassigned
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:2 Changed 7 years ago by mzipay

Individual CLA submitted 12/15, sorry for the delay.

comment:3 Changed 7 years ago by bill

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 6 years ago by Kitson Kelly

Owner: changed from dante to Kitson Kelly

comment:5 Changed 4 years ago by dylan

Milestone: tbd1.11
Owner: changed from Kitson Kelly to dylan

comment:6 Changed 4 years ago by dylans <dylan@…>

Resolution: fixed
Status: assignedclosed

In d864af2c0468cbe9dbf30de8b8ebd45f1bcf4363/dojox:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:7 Changed 4 years ago by dylans <dylan@…>

In 180d17d332fbcd87fd531dcc89fa172e6f9d44df/dojox:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:8 Changed 4 years ago by dylans <dylan@…>

In 2b845146311dcf792649f3e75c442738c7f325e6/dojox:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:9 Changed 4 years ago by dylans <dylan@…>

In ba3eea38a78dbf34651d10a75e1e53f08d912fa1/dojox:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:10 Changed 4 years ago by dylans <dylan@…>

In 29d2feceeef5d8fd1ad8df53754b6dce2be2fc8c/dojox:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:11 Changed 4 years ago by dylan

Milestone: 1.111.7.9

Thanks for the patch, accepted and included back through 1.7.x.

Note: See TracTickets for help on using tickets.