Skip to content

Commit

Permalink
Bugfix: dot char within XML attribute names not recognized EnlighterJ…
Browse files Browse the repository at this point in the history
  • Loading branch information
AndiDittrich committed Jun 27, 2020
1 parent 77dc8d6 commit f483470
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lang/xml.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ export class xml extends generic {
setupLanguage(){

// xml attributes. Stage-2 Analyzing
// @todo support unicode chars
// @see https://www.w3.org/TR/xml/#d0e804
// @see https://www.w3.org/TR/2011/WD-html5-20110525/syntax.html#syntax-attribute-name
function parseXmlAttributes(token){
// run the MicroTokenizer to identify the name=value match
return _microTokenizer(token, /\b([\w:-]+)(\s*=\s*)((['"]).*?\4|[^'" \t]+)/gi, function(match){
return _microTokenizer(token, /\b([^\s\0"'>/=]+)(\s*=\s*)((['"]).*?\4|[^'" \t]+)/gi, function(match){
// attribute name | assignment operator | attribute value (string)
return [_token(match[1], 'x2'), _token(match[2], 'k3'), _token(match[3], 's0')];
});
Expand Down

0 comments on commit f483470

Please sign in to comment.