User talk:Rob Linden/GeSHI Test

From Second Life Wiki
Jump to navigation Jump to search

There are two things that need to be done.

  1. 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.
  2. 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)