Content deleted Content added
Prevent side-effects of frame:preprocess on image descriptions, such as setting DEFAULTSORT |
Ignore File: text when linking bold title |
||
Line 468:
until not text or text == "" or not token or token == "" -- loop until all text parsed
text = mw.ustring.gsub(
return
end
Line 553:
text = cleanupText(text, true)
local filetext
-- replace the bold title or synonym near the start of the article by a wikilink to the article
Line 563 ⟶ 564:
text = mw.ustring.sub(text, 1, pos + 2) .. "[[" .. mw.ustring.sub(text, pos + 3, pos + len + 2) .. "]]" .. mw.ustring.sub(text, pos + len + 3, -1) -- link it
else -- look for anything unlinked in bold, assumed to be a synonym of the title (e.g. a person's birth name)
text = mw.ustring.gsub(text, "(
if
return
else
return nil -- instruct gsub to make no change
Line 571 ⟶ 572:
end, 1) -- "end" here terminates the anonymous replacement function(a, b) passed to gsub
end
text = filetext .. text
-- Seek and destroy unterminated templates and wikilinks
|