From 83d2673a261921da3bc51c394da525e9ae01fdcd Mon Sep 17 00:00:00 2001 From: Jeff Gehlbach Date: Thu, 20 Jun 2013 12:39:03 +0200 Subject: [PATCH] Fix replacement so that it works when a newline falls between 'the' and 'cloud' --- src/chrome/content/cloud-to-butt.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/chrome/content/cloud-to-butt.js b/src/chrome/content/cloud-to-butt.js index 8d41e9f..940281f 100644 --- a/src/chrome/content/cloud-to-butt.js +++ b/src/chrome/content/cloud-to-butt.js @@ -31,10 +31,10 @@ { var v = textNode.nodeValue; - v = v.replace(/\bThe Cloud\b/g, "My Butt"); - v = v.replace(/\bThe cloud\b/g, "My butt"); - v = v.replace(/\bthe Cloud\b/g, "my Butt"); - v = v.replace(/\bthe cloud\b/g, "my butt"); + v = v.replace(/\bThe(\s+)Cloud\b/g, "My$1Butt"); + v = v.replace(/\bThe(\s+)cloud\b/g, "My$1butt"); + v = v.replace(/\bthe(\s+)Cloud\b/g, "my$1Butt"); + v = v.replace(/\bthe(\s+)cloud\b/g, "my$1butt"); textNode.nodeValue = v; }