Module:Unicode data: Difference between revisions
From Savez
+is_rtl_frame (frame) entry point to gain access to is_rtl (str) from an invoke;
BalkanMapper (talk | contribs) m (1 revision imported) |
Track listing>Trappist the monk (+is_rtl_frame (frame) entry point to gain access to is_rtl (str) from an invoke;) |
||
Line 481: | Line 481: | ||
return result | return result | ||
end | end | ||
--[[--------------------------< I S _ R T L _ F R A M E >------------------------------------------------------ | |||
external entry from an {{#invoke:}} to determine if a string of text is rtl. Strips html and html-like tags so | |||
that those tags don't corrupt the is-rtl-is-not-rtl determination; this added for the cases where the rtl text | |||
has <br /> tags. | |||
]] | |||
function p.is_rtl_frame (frame) | |||
local str = frame.args[1]; -- get the string from the {{#invoke:}} frame | |||
str = str:gsub ('%b<>', ''); -- strip any html and html-like tags | |||
return p.is_rtl (str); -- return if whatever remains rtl; false else | |||
end | |||
local function get_codepoint(args, arg) | local function get_codepoint(args, arg) |