573
edits
(kind of fixed a too greedy regex. see FlightGear wiki talk:Instant-Cquotes#too greedy non-greedy regexes) |
(a2wikilinks: don't display the text from automatic forum links (http://blabla...bla)) |
||
Line 161: | Line 161: | ||
// they need special treatment, or they get displayed | // they need special treatment, or they get displayed | ||
html = html.replace(/<a[^(?:href)]*href="https?:\/\/wiki.flightgear.org\/(File:.*?)".*?>(.*?)<\/a>/g, "[[:$1|$2]]"); | html = html.replace(/<a[^(?:href)]*href="https?:\/\/wiki.flightgear.org\/(File:.*?)".*?>(.*?)<\/a>/g, "[[:$1|$2]]"); | ||
// automatic links to the wiki (we don't use the displayed text) | |||
html = html.replace(/<a[^(?:href)]*href="https?:\/\/wiki.flightgear.org\/(.*?)".*?>https?:\/\/wiki.flightgear.org.*?<\/a>/g, "[[$1]]"); | |||
// links to the wiki with custom text (we preserve it) | |||
html = html.replace(/<a[^(?:href)]*href="https?:\/\/wiki.flightgear.org\/(.*?)".*?>(.*?)<\/a>/g, "[[$1|$2]]"); | html = html.replace(/<a[^(?:href)]*href="https?:\/\/wiki.flightgear.org\/(.*?)".*?>(.*?)<\/a>/g, "[[$1|$2]]"); | ||
// then the others | // then the others | ||
html = html.replace(/<a[^(?:href)]*href="(.*?)".*?>(.*?)<\/a>/g, "[$1 $2]"); | html = html.replace(/<a[^(?:href)]*href="(.*?)".*?>(.*?)<\/a>/g, "[$1 $2]"); |
edits