మాడ్యూల్:Delink: కూర్పుల మధ్య తేడాలు

1,175 బైట్లు చేర్చారు ,  11 నెలల క్రితం
sync from sandbox per WP:VPT discussion;
చి (en:Module:Delink నుండి 54 కూర్పులు)
(sync from sandbox per WP:VPT discussion;)
end
 
local function delinkWikilink_tgt(s) -- return wikilink target |wikilinks=target
local function delinkWikilink(s)
local result = s
-- Deal with the reverse pipe trick.
-- Check for bad titles. To do this we need to find the
-- title area of the link, i.e. the part before any pipes.
local titleareatarget_area
if result:match("|") then -- Find if we're dealing with a piped link.
titleareatarget_area = result:match("^%[%[(.-)|.*%]%]")
else
titleareatarget_area = result:match("^%[%[(.-)%]%]")
end
-- Check for bad characters.
if mw.ustring.match(titleareatarget_area, "[%[%]<>{}%%%c\n]") then
return s
end
return target_area
end
 
local function delinkWikilink(s)
local result = s
-- Deal with the reverse pipe trick.
if result:match("%[%[|") then
return delinkReversePipeTrick(result)
end
result = mw.uri.decode(result, "PATH") -- decode percent-encoded entities. Leave underscores and plus signs.
result = mw.text.decode(result, true) -- decode HTML entities.
-- Check for bad titles. To do this we need to find the
-- title area of the link, i.e. the part before any pipes.
local target_area
if result:match("|") then -- Find if we're dealing with a piped link.
target_area = result:match("^%[%[(.-)|.*%]%]")
else
target_area = result:match("^%[%[(.-)%]%]")
end
-- Check for bad characters.
if mw.ustring.match(target_area, "[%[%]<>{}%%%c\n]") then
return s
end
 
-- Check for categories, interwikis, and files.
local colonprefix = result:match("%[%[(.-):.*%]%]") or "" -- Get the text before the first colon.
text = text:gsub("<!%-%-.-%-%->", "") -- Remove html comments.
end
if not (args.wikilinks == "no") and 'target' ~= args.wikilinks then
text = delinkLinkClass(text, "^%[%[.-%]%]", delinkWikilink) -- De-link wikilinks and return the label portion of the wikilink.
elseif 'target' == args.wikilinks then
end
text = delinkLinkClass(text, "^%[%[.-%]%]", delinkWikilink_tgt) -- De-link wikilinks and return the target portions of the wilikink
end
if not (args.urls == "no") then
text = delinkLinkClass(text, "^%[.-%]", delinkURL) -- De-link URLs.
0

దిద్దుబాట్లు

"https://te.wikipedia.org/wiki/ప్రత్యేక:MobileDiff/3230789" నుండి వెలికితీశారు