efront 4.22.11 → 4.22.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -7,7 +7,7 @@ predefs["module.exports"] = true;
|
|
|
7
7
|
predefs.Promise = true;
|
|
8
8
|
[Boolean, Number, String, Function, Object, Array, Date, RegExp, Error].forEach(p => predefs[p.name] = true);
|
|
9
9
|
var wrapLabel = function (content, typeName) {
|
|
10
|
-
return `<${
|
|
10
|
+
return `<${typeName}>${content}</${typeName}>`;
|
|
11
11
|
};
|
|
12
12
|
var amp = a => `&#${a.charCodeAt()};`;
|
|
13
13
|
var encodeAmp = function (a) {
|
|
@@ -92,6 +92,10 @@ var codecolor = function (c, encode) {
|
|
|
92
92
|
});
|
|
93
93
|
return t;
|
|
94
94
|
};
|
|
95
|
+
var wrapcode = encode ? function (t, l) {
|
|
96
|
+
t = encode(t);
|
|
97
|
+
return wrap(t, l);
|
|
98
|
+
} : wrap;
|
|
95
99
|
c.colored = true;
|
|
96
100
|
var setcolor = function (o) {
|
|
97
101
|
if (o.colored) return;
|
|
@@ -129,19 +133,19 @@ var codecolor = function (c, encode) {
|
|
|
129
133
|
break;
|
|
130
134
|
case ELEMENT:
|
|
131
135
|
if (o.attributes) o.attributes.forEach(setcolor);
|
|
132
|
-
if (o.tag_entry) o.tag_entry =
|
|
133
|
-
if (o.tag_leave) o.tag_leave =
|
|
134
|
-
if (o.entry) o.entry =
|
|
135
|
-
if (o.leave) o.leave =
|
|
136
|
-
o.tag =
|
|
136
|
+
if (o.tag_entry) o.tag_entry = wrapcode(o.tag_entry, 'stamp');
|
|
137
|
+
if (o.tag_leave) o.tag_leave = wrapcode(o.tag_leave, 'stamp');
|
|
138
|
+
if (o.entry) o.entry = wrapcode(o.entry, 'stamp');
|
|
139
|
+
if (o.leave) o.leave = wrapcode(o.leave, 'stamp');
|
|
140
|
+
o.tag = wrapcode(o.tag, 'label');
|
|
137
141
|
o.forEach(setcolor);
|
|
138
142
|
break;
|
|
139
143
|
case SCOPED:
|
|
140
144
|
deep++;
|
|
141
145
|
o.forEach(setcolor);
|
|
142
146
|
deep--;
|
|
143
|
-
o.entry =
|
|
144
|
-
o.leave =
|
|
147
|
+
o.entry = wrapcode(o.entry, 'deep' + deep);
|
|
148
|
+
o.leave = wrapcode(o.leave, 'deep' + deep);
|
|
145
149
|
break;
|
|
146
150
|
case VALUE:
|
|
147
151
|
if (o.isdigit) o.text = wrap(o.text, 'digit');
|
|
@@ -163,7 +167,7 @@ var codecolor = function (c, encode) {
|
|
|
163
167
|
else o.text = wrap(o.text, 'strap');
|
|
164
168
|
break;
|
|
165
169
|
case STAMP:
|
|
166
|
-
if (/^(=>)$/.test(o.text) || o.text === "*" && o.prev && o.prev.type === STRAP) o.text =
|
|
170
|
+
if (/^(=>)$/.test(o.text) || o.text === "*" && o.prev && o.prev.type === STRAP) o.text = wrapcode(o.text, 'strap');
|
|
167
171
|
break;
|
|
168
172
|
case COMMENT:
|
|
169
173
|
o.text = wraptext(o.text, 'comment');
|