-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Textpow 1.3.1] warning on bad unicode syntax #1
Comments
replacing them with |
The syntax to replace are :
[a-zA-Z0-9_\x7f-\xff]
|
aaah thought it meant all of unicode land :D then not sure how to fix this, if you add the
On Wed, Aug 28, 2013 at 2:41 PM, Ennder [email protected] wrote:
|
We should perhaps find in upstream if ascii characters [127, 255] are really accepted. |
might as well just kill the extra condition... take a small parsing bug vs On Wed, Aug 28, 2013 at 6:08 PM, Ennder [email protected] wrote:
|
You're right, I don't think such variable names cases will happen often ! |
Hi again, With Rails 3.2 logs are now filled with these warnings :
|
hmm maybe print some more info around there and see what syntax/line this is coming from -> PR ? |
Hi, here are more informations : lines that cause warnings in the textpow syntax files :
All these cases can be foud with a grep -R "A-Z-" *
Some others warnings will be difficult to catch, but this is a beginning |
can you throw that into a PR ? |
|
Texpow is used to syntax highlight source files in Redmine (plugin redmine_ultraviolet), Il try to provide a PR. |
Feel free to add a link in the readme, always nice to have more real-life On Wed, Jul 16, 2014 at 9:47 AM, Ennder [email protected] wrote:
|
For the utf8 issue : Regexp.new It's what is proposed here : It seems to pass, don't know if this will lead to a regression |
if something breaks we'll add more tests, no warnings is a nice win :) On Wed, Jul 16, 2014 at 10:36 AM, Ennder [email protected] wrote:
|
modifié: lib/textpow/syntax.rb modifié: lib/textpow/syntax/source.camlp4.ocaml.syntax modifié: lib/textpow/syntax/source.ocaml.syntax modifié: lib/textpow/syntax/text.bbcode.syntax modifié: lib/textpow/syntax/text.html.asp.net.syntax modifié: lib/textpow/syntax/text.html.mt.syntax modifié: lib/textpow/syntax/text.html.strict.active4d.syntax modifié: lib/textpow/syntax/text.html.tt.syntax modifié: lib/textpow/syntax/text.html.twiki.syntax modifié: lib/textpow/syntax/text.html.xhtml.1-strict.syntax modifié: lib/textpow/syntax/text.restructuredtext.syntax modifié: lib/textpow/syntax/text.tex.latex.sweave.syntax
Reference to Redmine added modifié: README.rdoc
Hi, I have done a PR, please check it, thanks |
Introducing myself : I work in a French company, developing enhancements on our Redmine instance.
I am migrating our developments to the last version of Redmine using Rails 3.
Some Textpow syntax yaml files trigger an annoying warning :
Ignored utf8 regex error invalid multibyte escape: /($)[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*?\b/
I tried to see why, and here is what I found :
The two syntax triggering the warning are :
textpow-1.3.1/lib/textpow/syntax/source.smarty.syntax: match: ($)[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]?\b
textpow-1.3.1/lib/textpow/syntax/source.mel.syntax: match: ($)[a-zA-Z\x7f-\xff][a-zA-Z0-9_\x7f-\xff]_?\b
What I understand is that these regexp contain an unicode range \x7f-\xff, but with rails 3 this unicode range is interpreted as real unicode.
The problem is that the range \x7f-\xff is outside utf8 legal values.
I know that you can specify to not interpret unicode character in full regular expressions, with adding a n at the end :
//no
But the syntax is different in the yam file (no /...../)
I did not find how to specify a range of ascii characters between 127 and 255.
The other question is why smarty and mel want such characters in variables names ?
Have you other ideas about this issue ?
The text was updated successfully, but these errors were encountered: