diff --git a/src/compiler/GF/Data/Str.hs b/src/compiler/GF/Data/Str.hs index 7b79add0a..7f1f4db75 100644 --- a/src/compiler/GF/Data/Str.hs +++ b/src/compiler/GF/Data/Str.hs @@ -44,8 +44,8 @@ type Ss = [String] -- matching functions in both ways matchPrefix :: Ss -> [(Ss,[String])] -> [String] -> Ss -matchPrefix s vs t = - head $ [u | let t' = concat (unmarkup t), +matchPrefix s vs t = + head $ [u | t':_ <- [unmarkup t], (u,as) <- vs, any (`isPrefixOf` t') as] ++ [s]