[[<link>|<label>]] → [[<link>]] when <link> and <label> are same value
This commit is contained in:
parent
4724cd3c55
commit
ca015c4f68
1 changed files with 5 additions and 2 deletions
|
|
@ -1019,9 +1019,12 @@ local function _cite_q (citeq_args)
|
|||
citeq_args['name-list-style'] = nil
|
||||
end
|
||||
|
||||
-- clean up any blank parameters
|
||||
for k, v in pairs(citeq_args) do
|
||||
if v == "" then citeq_args[k] = nil end
|
||||
if v == "" then citeq_args[k] = nil end -- remove blank parameters
|
||||
local link = v:match ('%[%[([^|]+)|%1%]%]'); -- get <link> from <v> wikilink [[<link>|<label>]] when <link> and <label> are same value
|
||||
if link then -- and if <link> and <label> are the same thing
|
||||
citeq_args[k] = '[[' .. link .. ']]'; -- rewrite <v> as [[<link>]]
|
||||
end
|
||||
end
|
||||
|
||||
-- if |expand=<anything>, write a nowiki'd version to see what the {{citation}} template call looks like
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue