Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/ui.js

Issue 5325266087837696: Issue 1675 - Use String.trim() to strip leading and trailing whitespaces (Firefox) (Closed)
Patch Set: Created Dec. 8, 2014, 5:24 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/filterClasses.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/ui.js
===================================================================
--- a/lib/ui.js
+++ b/lib/ui.js
@@ -954,12 +954,12 @@
mainSubscriptionURL = null;
// Trim spaces in title and URL
- title = title.replace(/^\s+/, "").replace(/\s+$/, "");
- url = url.replace(/^\s+/, "").replace(/\s+$/, "");
+ title = title.trim();
+ url = url.trim();
if (mainSubscriptionURL)
{
- mainSubscriptionTitle = mainSubscriptionTitle.replace(/^\s+/, "").replace(/\s+$/, "");
- mainSubscriptionURL = mainSubscriptionURL.replace(/^\s+/, "").replace(/\s+$/, "");
+ mainSubscriptionTitle = mainSubscriptionTitle.trim();
+ mainSubscriptionURL = mainSubscriptionURL.trim();
}
// Verify that the URL is valid
« no previous file with comments | « lib/filterClasses.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld