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

Unified Diff: include.postload.js

Issue 6438904399921152: Issue 1674 - Use String.trim() to strip leading and trailing whitespaces (Chrome/Opera/Safari) (Closed)
Patch Set: Created Dec. 8, 2014, 5:02 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 | « no previous file | options.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include.postload.js
===================================================================
--- a/include.postload.js
+++ b/include.postload.js
@@ -664,8 +664,8 @@
title = url;
// 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 (!/^(https?|ftp):/.test(url))
return;
« no previous file with comments | « no previous file | options.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld