Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: Source/devtools/front_end/common/utilities.js

Issue 539353004: DevTools: [Documentation] Update parser for WikiText (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add test for unescape symbols Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/common/utilities.js
diff --git a/Source/devtools/front_end/common/utilities.js b/Source/devtools/front_end/common/utilities.js
index e8509cec65ad5da9513b0cb7c60984653998d454..f42ab3ad537b39061e50a2735f0dbbb76c757916 100644
--- a/Source/devtools/front_end/common/utilities.js
+++ b/Source/devtools/front_end/common/utilities.js
@@ -169,6 +169,20 @@ String.prototype.escapeHTML = function()
/**
* @return {string}
*/
+String.prototype.unescapeHTML = function()
+{
+ return this.replace(/&lt;/g, "<")
+ .replace(/&gt;/g, ">")
+ .replace(/&#58;/g, ":")
+ .replace(/&quot;/g, "\"")
+ .replace(/&#60;/g, "<")
+ .replace(/&#62;/g, ">")
+ .replace(/&amp;/g, "&");
+}
+
+/**
+ * @return {string}
+ */
String.prototype.collapseWhitespace = function()
{
return this.replace(/[\s\xA0]+/g, " ");

Powered by Google App Engine
This is Rietveld 408576698