|
145 | 145 | { |
146 | 146 | for (var i = 0, attr, attr_value, attrs = ''; attr = node[ATTRS][i]; i++) |
147 | 147 | { |
148 | | - attr_value = helpers.escapeAttributeHtml(attr[ATTR_VALUE]); |
| 148 | + attr_value = helpers.escape_html_attr(attr[ATTR_VALUE]); |
149 | 149 | if (typeof is_search_hit != 'boolean' || is_search_hit) |
150 | 150 | { |
151 | 151 | attrs += " <key>" + safe_escape_attr_key(attr) + |
|
163 | 163 | { |
164 | 164 | for (var i = 0, attr, attr_value, attrs = ''; attr = node[ATTRS][i]; i++) |
165 | 165 | { |
166 | | - attr_value = helpers.escapeAttributeHtml(attr[ATTR_VALUE]); |
| 166 | + attr_value = helpers.escape_html_attr(attr[ATTR_VALUE]); |
167 | 167 | attrs += " <key>" + |
168 | 168 | "<match-token>" + safe_escape_attr_key(attr) + "</match-token>" + |
169 | 169 | "</key>=<value>\"" + |
|
199 | 199 | continue; |
200 | 200 | } |
201 | 201 | node_name = (node[NAMESPACE] ? node[NAMESPACE] + ':': '') + node[NAME]; |
202 | | - node_name = helpers.escapeTextHtml(node_name); |
| 202 | + node_name = helpers.escape_html(node_name); |
203 | 203 | if (force_lower_case && disregard_force_lower_case(node)) |
204 | 204 | { |
205 | 205 | disregard_force_lower_case_depth = node[DEPTH]; |
|
267 | 267 | "<div class='search-match dom-search comment pre-wrap' " + |
268 | 268 | "obj-id='" + node[ID] + "' handler='show-search-match' >" + |
269 | 269 | (open_tag ? open_tag + "!--" : "#comment") + |
270 | | - "<match-token>" + helpers.escapeTextHtml(node[VALUE]) + "</match-token>" + |
| 270 | + "<match-token>" + helpers.escape_html(node[VALUE]) + "</match-token>" + |
271 | 271 | (close_tag ? "--" + close_tag : "") + |
272 | 272 | "</div>"; |
273 | 273 | } |
|
305 | 305 | "<div class='search-match dom-search' " + |
306 | 306 | "obj-id='" + node[ID] + "' handler='show-search-match' >" + |
307 | 307 | "<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>" + |
309 | 309 | "</div>"; |
310 | 310 | } |
311 | 311 | } |
|
394 | 394 | case ELEMENT_NODE: |
395 | 395 | { |
396 | 396 | var node_name = (node[NAMESPACE] ? node[NAMESPACE] + ':' : '') + node[NAME]; |
397 | | - node_name = helpers.escapeTextHtml(node_name); |
| 397 | + node_name = helpers.escape_html(node_name); |
398 | 398 | var ev_listener = node[EVENT_LISTENER_LIST] && node[EVENT_LISTENER_LIST].length |
399 | 399 | ? EV_LISTENER_MARKUP |
400 | 400 | : ""; |
|
407 | 407 | attrs = ''; |
408 | 408 | for (k = 0; attr = node[ATTRS][k]; k++) |
409 | 409 | { |
410 | | - attr_value = helpers.escapeAttributeHtml(attr[ATTR_VALUE]); |
| 410 | + attr_value = helpers.escape_html_attr(attr[ATTR_VALUE]); |
411 | 411 | attrs += " <key>" + |
412 | 412 | ((attr[ATTR_PREFIX] ? attr[ATTR_PREFIX] + ':' : '') + |
413 | 413 | /* Regarding escaping "<". It happens that there are very |
|
453 | 453 | { |
454 | 454 | one_child_text_content += "<text" + |
455 | 455 | " ref-id='" + data[child_pointer][ID] + "' " + |
456 | | - ">" + helpers.escapeTextHtml(data[child_pointer][VALUE]) + "</text>"; |
| 456 | + ">" + helpers.escape_html(data[child_pointer][VALUE]) + "</text>"; |
457 | 457 | } |
458 | 458 | } |
459 | 459 | if (has_only_text_content) |
|
538 | 538 | "ref-id='" + node[ID] + "' " + |
539 | 539 | "class='comment pre-wrap'>" + |
540 | 540 | "<!--" + |
541 | | - helpers.escapeTextHtml(node[VALUE]) + |
| 541 | + helpers.escape_html(node[VALUE]) + |
542 | 542 | "--></div>"; |
543 | 543 | } |
544 | 544 | } |
|
570 | 570 | (no_contextmenu ? "" : "data-menu='dom-element' ") + |
571 | 571 | ">" + |
572 | 572 | "<text ref-id='"+ node[ID] + "' " + |
573 | | - ">" + helpers.escapeTextHtml(node[VALUE]) + "</text>" + |
| 573 | + ">" + helpers.escape_html(node[VALUE]) + "</text>" + |
574 | 574 | "</div>"; |
575 | 575 | } |
576 | 576 | } |
|
673 | 673 | case ELEMENT_NODE: |
674 | 674 | { |
675 | 675 | var node_name = (node[NAMESPACE] ? node[NAMESPACE] + ':' : '') + node[NAME]; |
676 | | - node_name = helpers.escapeTextHtml(node_name); |
| 676 | + node_name = helpers.escape_html(node_name); |
677 | 677 | if (force_lower_case) |
678 | 678 | { |
679 | 679 | node_name = node_name.toLowerCase(); |
|
683 | 683 | attrs = ''; |
684 | 684 | for (k = 0; attr = node[ATTRS][k]; k++) |
685 | 685 | { |
686 | | - attr_value = helpers.escapeAttributeHtml(attr[ATTR_VALUE]); |
| 686 | + attr_value = helpers.escape_html_attr(attr[ATTR_VALUE]); |
687 | 687 | attrs += " <key>" + |
688 | 688 | (attr[ATTR_PREFIX] ? attr[ATTR_PREFIX] + ':' : '') + |
689 | 689 | /* regarding escaping "<". it happens that there are very starnge keys in broken html. |
|
750 | 750 | "ref-id='"+node[ID] + "' " + |
751 | 751 | "class='comment pre-wrap'>" + |
752 | 752 | "<span class='comment-node'>#comment</span>" + |
753 | | - helpers.escapeTextHtml(node[VALUE]) + "</div>"; |
| 753 | + helpers.escape_html(node[VALUE]) + "</div>"; |
754 | 754 | } |
755 | 755 | break; |
756 | 756 | } |
|
793 | 793 | ">" + |
794 | 794 | (node[NAME] ? node[NAME] : this._node_name_map[node[TYPE]]) + |
795 | 795 | "<text ref-id='" + node[ID] + "' >" + |
796 | | - helpers.escapeTextHtml(node[VALUE]) + "</text>" + |
| 796 | + helpers.escape_html(node[VALUE]) + "</text>" + |
797 | 797 | "</div>"; |
798 | 798 | } |
799 | 799 | } |
|
808 | 808 | "<text ref-id='" + node[ID]+ "' " + |
809 | 809 | " class='" + (only_whitespace ? "only-whitespace" : "") + "'>" + |
810 | 810 | (only_whitespace ? helpers.escape_whitespace(node[VALUE]) |
811 | | - : helpers.escapeTextHtml(node[VALUE])) + |
| 811 | + : helpers.escape_html(node[VALUE])) + |
812 | 812 | "</text>" + |
813 | 813 | "</div>"; |
814 | 814 | } |
|
0 commit comments