[отпатрулированная версия][отпатрулированная версия]
Содержимое удалено Содержимое добавлено
форматирование URL для всех свойств с типом 'url'; получение типа свойства из Викиданных, а не по словарю
описание изображений
Строка 408:
 
local circumstances = context.getSourcingCircumstances( statement );
 
if statement.qualifiers then
options.qualifiers = statement.qualifiers;
end
 
if ( options.references ) then
Строка 542 ⟶ 546 :
end
image = image .. ']]'
if options['description'] and options['description'] ~= '' then
image = image .. '<br>' .. options['description']
end
return image
Строка 568 ⟶ 576 :
-- вызов обработчиков по умолчанию для известных типов значений
if datavalue.type == 'wikibase-entityid' then
-- Entity ID
-- идентификатор сущности
return function( context, options, value ) return formatEntityId( getEntityIdFromValue( value ), options ) end;
elseif datavalue.type == 'string' then
-- строкаString
if datatype and datatype == 'commonsMedia' then
-- медиафайлMedia
return function( context, options, value ) return formatCommonsMedia( value, options ) end;
local lang = mw.language.getContentLanguage()
if ( not options.description or options.description == '' )
and options.qualifiers and options.qualifiers.P2096 then
for i, qualifier in pairs( options.qualifiers.P2096 ) do
if ( qualifier
and qualifier.datavalue
and qualifier.datavalue.type == 'monolingualtext'
and qualifier.datavalue.value
and qualifier.datavalue.value.language == lang:getCode() ) then
options.description = qualifier.datavalue.value.text
break
end
end
end
return formatCommonsMedia( value, options )
end;
elseif datatype and datatype == 'url' then
-- URL