highlight.js
Advanced tools
Comparing version 10.3.0 to 10.3.1
@@ -129,11 +129,36 @@ /* | ||
}, | ||
{ | ||
className: 'number', | ||
variants: [ | ||
// Special case: only hexadecimal binary powers can contain fractions. | ||
{ begin: /(?<![a-zA-Z0-9._])0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/ }, | ||
{ begin: /(?<![a-zA-Z0-9._])0[xX][0-9a-fA-F]+([pP][+-]?\d+)?[Li]?/ }, | ||
{ begin: /(?<![a-zA-Z0-9._])(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?[Li]?/ } | ||
// TODO: replace with negative look-behind when available | ||
// { begin: /(?<![a-zA-Z0-9._])0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/ }, | ||
// { begin: /(?<![a-zA-Z0-9._])0[xX][0-9a-fA-F]+([pP][+-]?\d+)?[Li]?/ }, | ||
// { begin: /(?<![a-zA-Z0-9._])(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?[Li]?/ } | ||
// The below rules all eat an extra character in front (for the | ||
// look-behind check) and then exclude it from the match, but I think | ||
// in many cases this will work out just fine. | ||
{ | ||
// Special case: only hexadecimal binary powers can contain fractions. | ||
begin: /([^a-zA-Z0-9._])(?=0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?)/, | ||
end: /0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/, | ||
excludeBegin: true | ||
}, | ||
{ | ||
begin: /([^a-zA-Z0-9._])(?=0[xX][0-9a-fA-F]+([pP][+-]?\d+)?[Li]?)/, | ||
end: /0[xX][0-9a-fA-F]+([pP][+-]?\d+)?[Li]?/ , | ||
excludeBegin: true | ||
}, | ||
{ | ||
begin: /([^a-zA-Z0-9._])(?=(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?[Li]?)/, | ||
end: /(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?[Li]?/, | ||
excludeBegin: true | ||
} | ||
], | ||
// "on:begin": (match, response) => { | ||
// if (match.index > 0) { | ||
// let priorChar = match.input[match.index - 1]; | ||
// if (priorChar.match(/[a-zA-Z0-9._]/)) response.ignoreMatch(); | ||
// } | ||
// }, | ||
relevance: 0 | ||
@@ -140,0 +165,0 @@ }, |
@@ -9,3 +9,3 @@ { | ||
"homepage": "https://highlightjs.org/", | ||
"version": "10.3.0", | ||
"version": "10.3.1", | ||
"author": { | ||
@@ -12,0 +12,0 @@ "name": "Ivan Sagalaev", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1545173
35610