Fix wikipedia's apostrophe issue

in
Subscribe to Fix wikipedia's apostrophe issue 3 posts, 1 voice



fusen Scriptwright
FirefoxWindows

Change line 100 from;

new Element('a').set({'href':result.Url,'target':'_blank'}).set({'text' : 'View Entry'}).inject(text);

to

new Element('a').set({'href':result.Url.replace(/?/g, "'"),'target':'_blank'}).set({'text' : 'View Entry'}).inject(text);

Now instead of the wikipedia 'View Entry' link failing whenever you are looking up an item that includes an apostrophe, it'll actually send you to the correct page.

 
fusen Scriptwright
FirefoxWindows

ah bugger, it seems the comment has removed the EXACT part that this fix addresses,

where it says;

replace(/?/g,

it should show

replace(/&ap os;/g,

BUT REMOVE THE SPACE between 'ap' and 'os' so it's all one continuous word

 
fusen Scriptwright
FirefoxWindows

so it's like this;

new Element('a').set({'href':result.Url.replace(/&ap os;/g, "'"),'target':'_blank'}).set({'text' : 'View Entry'}).inject(text);

but obviously remove the space between ap and os

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel