Editing Module:Color
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
| Latest revision | Your text | ||
| Line 105: | Line 105: | ||
-- Helper method to search given text for the keys of given table t. | -- Helper method to search given text for the keys of given table t. | ||
-- If a key is found, returns its value; returns nil otherwise. | -- If a key is found, returns its value; returns nil otherwise. | ||
local function searchTextForKeys(text, t) | local function searchTextForKeys(text, t) | ||
for key, val in pairs(t) do | |||
result = mw.ustring.find(text, key, 1, true) | |||
if result ~= nil then return val end | |||
end | end | ||
end | end | ||