summaryrefslogtreecommitdiff
path: root/tex/context/base/char-utf.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/char-utf.lua')
-rw-r--r--tex/context/base/char-utf.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/tex/context/base/char-utf.lua b/tex/context/base/char-utf.lua
index 79f5718fd..2d11a1794 100644
--- a/tex/context/base/char-utf.lua
+++ b/tex/context/base/char-utf.lua
@@ -62,7 +62,9 @@ end
function characters.filters.utf.collapse(str)
if characters.filters.utf.collapsing and str and #str > 1 then
- characters.filters.utf.initialize()
+ if not characters.filters.utf.initialized then -- saves a call
+ characters.filters.utf.initialize()
+ end
local tokens, first, done = { }, false, false
local cg = characters.graphemes
for second in string.utfcharacters(str) do
@@ -152,7 +154,9 @@ do
function characters.filters.utf.collapse(str)
if characters.filters.utf.collapsing and str then
if #str > 1 then
- characters.filters.utf.initialize()
+ if not characters.filters.utf.initialized then -- saves a call
+ characters.filters.utf.initialize()
+ end
local tokens, first, done = { }, false, false
for second in string.utfcharacters(str) do
if cr[second] then
@@ -257,7 +261,7 @@ end
function characters.filters.process(str)
if characters.filters.activated then
- for _,v in pairs(characters.filters.sequences) do
+ for _,v in ipairs(characters.filters.sequences) do
str = v(str)
end
return str