User talk:Rob Linden/GeSHI Test: Difference between revisions
New page: There are two things that need to be done. #Remove the LSL_ prefix from the autolinking. That is left over from the dark ages and no new articles use this. None of the constants use this ... |
No edit summary |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 2: | Line 2: | ||
#Remove the LSL_ prefix from the autolinking. That is left over from the dark ages and no new articles use this. None of the constants use this so despite there being a page for TRUE, the highlighter doesn't think there is one. | #Remove the LSL_ prefix from the autolinking. That is left over from the dark ages and no new articles use this. None of the constants use this so despite there being a page for TRUE, the highlighter doesn't think there is one. | ||
# | #Add some CSS to hide the underlining. <code>pre.code A{ text-decoration:none; }</code> | ||
--[[User:Strife Onizuka|Strife Onizuka]] | Little GM script I wrote that does both of these. | ||
<javascript>// ==UserScript== | |||
// @name LSL Style | |||
// @namespace http://home.comcast.net/~mailerdaemon/ | |||
// @include https://wiki.secondlife.com/* | |||
// @include http://wiki.secondlife.com/* | |||
// ==/UserScript== | |||
GM_addStyle("pre.code a{ text-decoration:none; }") | |||
var regex = /LSL_/; | |||
var res = document.evaluate("//pre[@class='code']/a", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); | |||
for (i = 0; link = res.snapshotItem(i); ++i) { | |||
var t = link.attributes.getNamedItem("href"); | |||
t.value = t.value.replace(regex, ""); | |||
}</javascript> | |||
The first can be easily fixed. | |||
<php> 'URLS' => array( | |||
1 => '/wiki/LSL_{FNAME}', | |||
2 => '/wiki/LSL_{FNAME}', | |||
3 => '/wiki/{FNAME}', | |||
4 => '/wiki/Special:Search&go=Go&search=LSL_{FNAME}', | |||
5 => '/wiki/LSL_{FNAME}' | |||
),</php> | |||
Change the above to the below. | |||
<php> 'URLS' => array( | |||
1 => '/wiki/{FNAME}', | |||
2 => '/wiki/{FNAME}', | |||
3 => '/wiki/{FNAME}', | |||
4 => '/wiki/Special:Search&go=Go&search={FNAME}', | |||
5 => '/wiki/{FNAME}' | |||
),</php> | |||
-- [[User:Strife Onizuka|Strife Onizuka]] 05:26, 30 November 2007 (PST) | |||
:I just noticed a bug, when you have multiple languages displayed on a page, the styles get overridden. -- [[User:Strife Onizuka|Strife Onizuka]] 05:27, 30 November 2007 (PST) | |||
Latest revision as of 06:27, 30 November 2007
There are two things that need to be done.
- Remove the LSL_ prefix from the autolinking. That is left over from the dark ages and no new articles use this. None of the constants use this so despite there being a page for TRUE, the highlighter doesn't think there is one.
- Add some CSS to hide the underlining.
pre.code A{ text-decoration:none; }
Little GM script I wrote that does both of these. <javascript>// ==UserScript== // @name LSL Style // @namespace http://home.comcast.net/~mailerdaemon/ // @include https://wiki.secondlife.com/* // @include http://wiki.secondlife.com/* // ==/UserScript==
GM_addStyle("pre.code a{ text-decoration:none; }") var regex = /LSL_/; var res = document.evaluate("//pre[@class='code']/a", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); for (i = 0; link = res.snapshotItem(i); ++i) { var t = link.attributes.getNamedItem("href"); t.value = t.value.replace(regex, ""); }</javascript>
The first can be easily fixed. <php> 'URLS' => array( 1 => '/wiki/LSL_{FNAME}', 2 => '/wiki/LSL_{FNAME}', 3 => '/wiki/{FNAME}', 4 => '/wiki/Special:Search&go=Go&search=LSL_{FNAME}', 5 => '/wiki/LSL_{FNAME}' ),</php> Change the above to the below. <php> 'URLS' => array( 1 => '/wiki/{FNAME}', 2 => '/wiki/{FNAME}', 3 => '/wiki/{FNAME}', 4 => '/wiki/Special:Search&go=Go&search={FNAME}', 5 => '/wiki/{FNAME}' ),</php> -- Strife Onizuka 05:26, 30 November 2007 (PST)
- I just noticed a bug, when you have multiple languages displayed on a page, the styles get overridden. -- Strife Onizuka 05:27, 30 November 2007 (PST)