Ticket #4120 (closed bug: wontfix)
Be more liberal in accepting IDs
|Reported by:||brettz9||Owned by:||john|
In your core code I think:
quickExpr = /[<]*(<(.|\s)+>)[>]*$|#([\w-]+)$/
should allow the # selector be changed to be more liberal in accepting valid XML IDs:
var nameStartChar = ':A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u0200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\ud800-\udb7f\udc00-\udfff'; // The last two ranges are for surrogates that comprise #x10000-#xEFFFF var nameEndChar = '.0-9\u00B7\u0300-\u036F\u203F-\u2040-'; var xmlName = '['+nameStartChar+']['+nameStartChar+nameEndChar+']*'; ///////// quickExpr = new RegExp('[<]*(<(.|\s)+>)[>]*$|#('+xmlName+')$');
Per http://www.w3.org/TR/1999/REC-html401-19991224/types.html#type-name , unlike XML, HTML does not allow ':' or '_' at the beginning of an ID, nor does it allow any of the Unicode hex sequences above, but it is otherwise the same (i.e., the above expression for XML would work for HTML in being excessively liberal, as is the existing regexp).
I have not attempted to narrow down the first alternative in the expression, but that at least is not overly restrictive.
If you don't care for this verbosity (though I hope you wouldn't mind being XML friendly for the future), I think you could at least add the period to the latter alternative:
quickExpr = /[<]*(<(.|\s)+>)[>]*$|#([\w.-]+)$/
since '.' is allowable in an HTML or XML ID and might be more widely used. See
This shouldn't interfere with other selectors since the Regex portion I've updated is only for detecting IDs.
- Owner set to john
- Component changed from unfilled to selector
- Status changed from closed to reopened
- Resolution wontfix deleted
- Priority changed from minor to high
- Status changed from reopened to open
- Version changed from 1.3.1 to 1.4.4
- Milestone changed from 1.3.2 to 1.5