Skip to content

Commit 9eb1e29

Browse files
committed
Renamed 'escapeTextHtml' to 'escape_html' and 'escapeAttributeHtml' to 'escape_html_attr'.
1 parent a978caa commit 9eb1e29

File tree

11 files changed

+72
-72
lines changed

11 files changed

+72
-72
lines changed

src/ecma-debugger/dominspection/domserializer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ window.cls.DOMSerializer.prototype = new function()
159159
{
160160
tree += LINEBREAK + getIndent(node[DEPTH] - start_depth) +
161161
"<" + node_name + attrs + ">" +
162-
helpers.escapeTextHtml(one_child_value) +
162+
helpers.escape_html(one_child_value) +
163163
"</" + node_name + ">";
164164
i = child_pointer - 1;
165165
}
@@ -216,7 +216,7 @@ window.cls.DOMSerializer.prototype = new function()
216216
{
217217
if( !/^\s*$/.test(node[ VALUE ] ) )
218218
{
219-
tree += LINEBREAK + getIndent(node[DEPTH] - start_depth) + helpers.escapeTextHtml(node[VALUE]);
219+
tree += LINEBREAK + getIndent(node[DEPTH] - start_depth) + helpers.escape_html(node[VALUE]);
220220
}
221221
}
222222
}

src/ecma-debugger/dominspection/templates.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
{
146146
for (var i = 0, attr, attr_value, attrs = ''; attr = node[ATTRS][i]; i++)
147147
{
148-
attr_value = helpers.escapeAttributeHtml(attr[ATTR_VALUE]);
148+
attr_value = helpers.escape_html_attr(attr[ATTR_VALUE]);
149149
if (typeof is_search_hit != 'boolean' || is_search_hit)
150150
{
151151
attrs += " <key>" + safe_escape_attr_key(attr) +
@@ -163,7 +163,7 @@
163163
{
164164
for (var i = 0, attr, attr_value, attrs = ''; attr = node[ATTRS][i]; i++)
165165
{
166-
attr_value = helpers.escapeAttributeHtml(attr[ATTR_VALUE]);
166+
attr_value = helpers.escape_html_attr(attr[ATTR_VALUE]);
167167
attrs += " <key>" +
168168
"<match-token>" + safe_escape_attr_key(attr) + "</match-token>" +
169169
"</key>=<value>\"" +
@@ -199,7 +199,7 @@
199199
continue;
200200
}
201201
node_name = (node[NAMESPACE] ? node[NAMESPACE] + ':': '') + node[NAME];
202-
node_name = helpers.escapeTextHtml(node_name);
202+
node_name = helpers.escape_html(node_name);
203203
if (force_lower_case && disregard_force_lower_case(node))
204204
{
205205
disregard_force_lower_case_depth = node[DEPTH];
@@ -267,7 +267,7 @@
267267
"<div class='search-match dom-search comment pre-wrap' " +
268268
"obj-id='" + node[ID] + "' handler='show-search-match' >" +
269269
(open_tag ? open_tag + "!--" : "#comment") +
270-
"<match-token>" + helpers.escapeTextHtml(node[VALUE]) + "</match-token>" +
270+
"<match-token>" + helpers.escape_html(node[VALUE]) + "</match-token>" +
271271
(close_tag ? "--" + close_tag : "") +
272272
"</div>";
273273
}
@@ -305,7 +305,7 @@
305305
"<div class='search-match dom-search' " +
306306
"obj-id='" + node[ID] + "' handler='show-search-match' >" +
307307
"<span class='dom-search-text-node'>#text</span>" +
308-
"<match-token>" + helpers.escapeTextHtml(node[VALUE]) + "</match-token>" +
308+
"<match-token>" + helpers.escape_html(node[VALUE]) + "</match-token>" +
309309
"</div>";
310310
}
311311
}
@@ -394,7 +394,7 @@
394394
case ELEMENT_NODE:
395395
{
396396
var node_name = (node[NAMESPACE] ? node[NAMESPACE] + ':' : '') + node[NAME];
397-
node_name = helpers.escapeTextHtml(node_name);
397+
node_name = helpers.escape_html(node_name);
398398
var ev_listener = node[EVENT_LISTENER_LIST] && node[EVENT_LISTENER_LIST].length
399399
? EV_LISTENER_MARKUP
400400
: "";
@@ -407,7 +407,7 @@
407407
attrs = '';
408408
for (k = 0; attr = node[ATTRS][k]; k++)
409409
{
410-
attr_value = helpers.escapeAttributeHtml(attr[ATTR_VALUE]);
410+
attr_value = helpers.escape_html_attr(attr[ATTR_VALUE]);
411411
attrs += " <key>" +
412412
((attr[ATTR_PREFIX] ? attr[ATTR_PREFIX] + ':' : '') +
413413
/* Regarding escaping "<". It happens that there are very
@@ -453,7 +453,7 @@
453453
{
454454
one_child_text_content += "<text" +
455455
" ref-id='" + data[child_pointer][ID] + "' " +
456-
">" + helpers.escapeTextHtml(data[child_pointer][VALUE]) + "</text>";
456+
">" + helpers.escape_html(data[child_pointer][VALUE]) + "</text>";
457457
}
458458
}
459459
if (has_only_text_content)
@@ -538,7 +538,7 @@
538538
"ref-id='" + node[ID] + "' " +
539539
"class='comment pre-wrap'>" +
540540
"&lt;!--" +
541-
helpers.escapeTextHtml(node[VALUE]) +
541+
helpers.escape_html(node[VALUE]) +
542542
"--&gt;</div>";
543543
}
544544
}
@@ -570,7 +570,7 @@
570570
(no_contextmenu ? "" : "data-menu='dom-element' ") +
571571
">" +
572572
"<text ref-id='"+ node[ID] + "' " +
573-
">" + helpers.escapeTextHtml(node[VALUE]) + "</text>" +
573+
">" + helpers.escape_html(node[VALUE]) + "</text>" +
574574
"</div>";
575575
}
576576
}
@@ -673,7 +673,7 @@
673673
case ELEMENT_NODE:
674674
{
675675
var node_name = (node[NAMESPACE] ? node[NAMESPACE] + ':' : '') + node[NAME];
676-
node_name = helpers.escapeTextHtml(node_name);
676+
node_name = helpers.escape_html(node_name);
677677
if (force_lower_case)
678678
{
679679
node_name = node_name.toLowerCase();
@@ -683,7 +683,7 @@
683683
attrs = '';
684684
for (k = 0; attr = node[ATTRS][k]; k++)
685685
{
686-
attr_value = helpers.escapeAttributeHtml(attr[ATTR_VALUE]);
686+
attr_value = helpers.escape_html_attr(attr[ATTR_VALUE]);
687687
attrs += " <key>" +
688688
(attr[ATTR_PREFIX] ? attr[ATTR_PREFIX] + ':' : '') +
689689
/* regarding escaping "<". it happens that there are very starnge keys in broken html.
@@ -750,7 +750,7 @@
750750
"ref-id='"+node[ID] + "' " +
751751
"class='comment pre-wrap'>" +
752752
"<span class='comment-node'>#comment</span>" +
753-
helpers.escapeTextHtml(node[VALUE]) + "</div>";
753+
helpers.escape_html(node[VALUE]) + "</div>";
754754
}
755755
break;
756756
}
@@ -793,7 +793,7 @@
793793
">" +
794794
(node[NAME] ? node[NAME] : this._node_name_map[node[TYPE]]) +
795795
"<text ref-id='" + node[ID] + "' >" +
796-
helpers.escapeTextHtml(node[VALUE]) + "</text>" +
796+
helpers.escape_html(node[VALUE]) + "</text>" +
797797
"</div>";
798798
}
799799
}
@@ -808,7 +808,7 @@
808808
"<text ref-id='" + node[ID]+ "' " +
809809
" class='" + (only_whitespace ? "only-whitespace" : "") + "'>" +
810810
(only_whitespace ? helpers.escape_whitespace(node[VALUE])
811-
: helpers.escapeTextHtml(node[VALUE])) +
811+
: helpers.escape_html(node[VALUE])) +
812812
"</text>" +
813813
"</div>";
814814
}

src/ecma-debugger/helpers.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ window.cls.Helpers = function()
113113
|| top_url.replace(/\?.*$/, '').replace(/#.*$/, '').replace(/\/[^/]*$/, "/") + url );
114114
}
115115

116-
this.escapeTextHtml = (function()
116+
this.escape_html = (function()
117117
{
118118
var re_amp = /&/g;
119119
var re_lt = /</g;
@@ -127,13 +127,13 @@ window.cls.Helpers = function()
127127
}
128128
})();
129129

130-
this.escapeAttributeHtml = (function()
130+
this.escape_html_attr = (function()
131131
{
132132
var re_quot = /"/g;
133133
var re_apos = /'/g;
134134
return function(str)
135135
{
136-
return str ? this.escapeTextHtml(str)
136+
return str ? this.escape_html(str)
137137
.replace(re_quot, "&quot;")
138138
.replace(re_apos, "&#x27;")
139139
: str;

src/ecma-debugger/objectinspection.6.0/templates.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
for (var prop = null, i = 0; prop = property_list[i]; i++)
154154
{
155155
value = prop[PROPERTY_VALUE];
156-
esc_name = helpers.escapeAttributeHtml(prop[NAME]);
156+
esc_name = helpers.escape_html_attr(prop[NAME]);
157157
switch (type = prop[PROPERTY_TYPE])
158158
{
159159
case "number":
@@ -206,7 +206,7 @@
206206
}
207207
short_val = value.length > MAX_VALUE_LENGTH ?
208208
value.slice(0, MAX_VALUE_LENGTH) + '…' : '';
209-
value = helpers.escapeAttributeHtml(value);
209+
value = helpers.escape_html_attr(value);
210210
if (short_val)
211211
{
212212
if (!searchterm ||
@@ -219,7 +219,7 @@
219219
"<key data-spec='dom#" + esc_name + "'" +
220220
editable(prop) + ">" + esc_name + "</key>\u00A0" +
221221
"<value class='" + type + "' data-value='\"" + value + "\"'>" +
222-
"\"" + helpers.escapeTextHtml(short_val) + "\"" +
222+
"\"" + helpers.escape_html(short_val) + "\"" +
223223
"</value>" +
224224
"</item>"
225225
);

src/syntaxhighlight/js/tokenizer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ cls.SimpleJSParser.prototype = new function()
869869
if(__parse_error_first_token)
870870
{
871871
__line = "<div class='error-description'>" +
872-
helpers.escapeTextHtml(__parse_error_description) +
872+
helpers.escape_html(__parse_error_description) +
873873
"</div>" +
874874
"<span class='not-error'>" + __line + "</span>" +
875875
"<span class='first-error'>" + __buffer + "</span>";

src/window-manager/window-manager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ cls.WindowManager["2.0"].WindowsDropDown = function()
397397
return (
398398
'<option value="' + win.window_id + '"' +
399399
( win.window_id == window_manager_data.get_debug_context() ? ' selected="selected"' : '' ) + '>' +
400-
helpers.escapeTextHtml(win.title || "") +
400+
helpers.escape_html(win.title || "") +
401401
'</option>');
402402
}
403403

0 commit comments

Comments
 (0)