יחידה:RTLtimeline: הבדלים בין גרסאות בדף

מתוך חב"דציטוט, מאגר ציטוטים חב"דים חופשי.
קפיצה לניווט קפיצה לחיפוש
(מויקיפדיה: https://he.wikipedia.org/wiki/%D7%99%D7%97%D7%99%D7%93%D7%94:RTLtimeline)
 
מ (גרסה אחת יובאה)
 
(אין הבדלים)

גרסה אחרונה מ־00:08, 27 ביוני 2024

ניתן ליצור תיעוד על היחידה הזאת בדף יחידה: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