Skip to content

Commit e4ab69d

Browse files
pparidansXavier-Do
authored andcommitted
[REF] runbot: linting: useless escaping in js
Escaping non-special characters in strings, template literals, and regular expressions doesn’t have any effect.
1 parent 82ab595 commit e4ab69d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

runbot/static/src/js/fields/fields.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { BooleanToggleField } from "@web/views/fields/boolean_toggle/boolean_tog
1616
// https://stackoverflow.com/questions/4810841/pretty-print-json-using-javascript
1717
function colorizeJson(json) {
1818
json = json.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
19-
return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) {
19+
return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+-]?\d+)?)/g, function (match) {
2020
let cls = "";
2121
if (/^"/.test(match)) {
2222
if (/:$/.test(match)) {

0 commit comments

Comments
 (0)