Changes

Jump to: navigation, search

Module:Autolink

227 bytes added, 1 year ago
from sandbox: don't format SMW annotations if they're included in the input
local post = line
while post:find( '[[', 1, true ) do
local pre, annotation, target, txt if post:match( '^[^%[]*%[%[[^|%]]+::' ) then -- don't format SMW annotations pre, annotation = post:match( '^([^%[]*)(%[%[[^%]]+%]%])' ) else pre, target, txt = post:match( '^([^%[]*)%[%[%s*([^|%]]+)%s*|?%s*([^%]]-)%s*%]%]' ) end table.insert( prettified_line, ('%s%s'):format( pre and pre:gsub( '""', '"' ) or '', target and prettify_link( target, txt ) or annotation ) )
post = post:match( '%]%](.*)$' )
end

Navigation menu