diff options
author | drry | 2008-11-03 15:23:58 +0000 |
---|---|---|
committer | drry | 2008-11-03 15:23:58 +0000 |
commit | b95f775693bc6aaa150c995cce9faa50aee45b4b (patch) | |
tree | bbb120508f5df571964282e2c2ede8c37dba275e /reading.js | |
parent | fe0f5dc25d104cde717869de83a6388afe70e069 (diff) | |
download | vimperator-plugins-b95f775693bc6aaa150c995cce9faa50aee45b4b.tar.bz2 |
* fixed and removed regexes.
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@22651 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'reading.js')
-rw-r--r-- | reading.js | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -56,7 +56,7 @@ const POST_URL = 'https://twitter.com/statuses/update.json'; function Scraper() {}
Scraper.prototype = {
constants: {
- VERSION: '0.22',
+ VERSION: '0.22',
},
version: function() { return this.constants.VERSION; },
@@ -68,9 +68,8 @@ Scraper.prototype = { getTitle: function() {
var title = $f('//title');
return title
- ? title.text.replace(/^\s+/, '')
- .replace(/\s+$/, '')
- .replace(/\n/g, ' ')
+ ? title.text.replace(/^\s+|\s+$/g, '')
+ .replace(/\r\n|[\r\n\t]/g, ' ')
: null;
},
@@ -138,7 +137,7 @@ liberator.modules.commands.addUserCommand(['reading'], "update Twitter's status },
// complete logic is none.
{
- bang: true,
+ bang: true,
}
);
@@ -176,7 +175,7 @@ function canonicalizeURL(url) { req.open('GET', PATHTRAQ_CANONICALIZE_URL_API + encodeURI(url), false);
req.send(null);
if(req.status === 200) {
- let canonicalized = req.responseText.replace(/^"/, '').replace(/"$/, '');
+ let canonicalized = req.responseText.replace(/^"|"$/g, '');
return canonicalized ? canonicalized : url;
}
else {
|