Изменения
Перейти к навигации
Перейти к поиску
← Предыдущая правка
Следующая правка →
Модуль:RadicalWikifier
(посмотреть исходный код)
Версия от 16:53, 3 сентября 2023
79 байт добавлено
,
2 года назад
assimilating spans
Строка 139:
Строка 139:
-- If there is only one child node, and it can be safely assimilated into the parent node:
-- If there is only one child node, and it can be safely assimilated into the parent node:
local function assimilate (node)
local function assimilate (node)
−
if #node =
= 0 or #node >
1 then
+
if #node
~
=
1 then
return node
return node
end
end
Строка 150:
Строка 150:
child = assimilate (child)
child = assimilate (child)
for key, value in pairs (child) do
for key, value in pairs (child) do
−
if key == 'style' and node [key] and node [key] ~= '' then
+
if key ~= '__name' then
−
node [key] = node [key] .. '; ' .. value
+
if key == 'style' and node [key] and node [key] ~= '' then
−
else
+
node [key] = node [key] .. '; ' .. value
−
node [key] = value
+
else
+
node [key] = value
+
end
end
end
end
end
−
node [1] = child [1]
end
end
return node
return node
Строка 236:
Строка 237:
--return frame:preprocess (tostring (grammar:match (test)))
--return frame:preprocess (tostring (grammar:match (test)))
return mw.dumpObject (grammar:match (test))
return mw.dumpObject (grammar:match (test))
+
end,
+
test2 = function (txt)
+
return mw.dumpObject (grammar:match (txt))
end
end
}
}
Александр Машин
Бюрократы
, steward,
Администраторы
1714
правок
Реклама:
Навигация
Персональные инструменты
русский
Вы не представились системе
Обсуждение
Вклад
Создать учётную запись
Войти
Пространства имён
Модуль
Комментарии
Варианты
Просмотры
Читать
Посмотреть код
История
Ещё
Поиск
Навигация
Заглавная страница
Форум
Текущие события
Свежие правки
Случайный документ
Статистика
Справка
Порталы
Новости
Инструменты
Служебные страницы
Версия для печати