יחידה:RTLtimeline

מתוך ויקיפדיה, האנציקלופדיה החופשית

ניתן ליצור תיעוד על היחידה הזאת בדף יחידה:RTLtimeline/תיעוד

local p = {}

local rev = function( text )

    local tab = mw.text.split( text or '', '' )
    local restab = {}
    for i = #tab, 1, -1 do table.insert( restab, tab[i] ) end
    return table.concat( restab )
end

function p.timeline( frame )
	-- reverse RTL strings in timeline. warning: doesn't work for RTL combined with latin/number chars
	local timeline_code = frame.args['content']
	timeline_code = mw.ustring.gsub( timeline_code, '"[א-ת ]-"', rev)
	return frame:extensionTag{ name = 'timeline', content = timeline_code }
end
 
return p