15.133
Bearbeitungen
(Optimierung setPageAttr()) Markierung: Zurückgesetzt |
(Änderung 756274 von HeikoBot (Diskussion) rückgängig gemacht.) Markierung: Rückgängigmachung |
||
| Zeile 392: | Zeile 392: | ||
end | end | ||
end | end | ||
if mw.smw.getPropertyType(attr_name) == "_wpg" then | if mw.smw.getPropertyType(attr_name) == "_wpg" and string.find(val, "%[") == nil and string.find(val, "<") == nil then | ||
t = t .. p.setPageAttr(attr_name, val) | t = t .. p.setPageAttr(attr_name, val) | ||
else | else | ||
| Zeile 509: | Zeile 509: | ||
function p.setPageAttr(name, val) | function p.setPageAttr(name, val) | ||
local t = "" | local t = "" | ||
if | if wik.pageexists(val) then | ||
t = t .. "[[" .. name .. "::" .. val .. "]]" | t = t .. "[[" .. name .. "::" .. val .. "]]" | ||
else | else | ||
val_pre_bracket, val_without_bracket, val_post_bracket = str.bracketSplitAndStrip(val) | val_pre_bracket, val_without_bracket, val_post_bracket = str.bracketSplitAndStrip(val) | ||
if | if wik.pageexists(val_without_bracket) then | ||
if val_pre_bracket ~= "" then | if val_pre_bracket ~= "" then | ||
t = t .. val_pre_bracket .. " " | t = t .. val_pre_bracket .. " " | ||