Hans,

here is a patch, copied from buff-imp-xml.lua, so that XML elements are
highlighted when they contain non-ASCII chars.

MWE that shows the issue (commenting the first line gives different
results):

  \usemodule[scite]
  \starttext
  \startTEXpage[offset=1ex]
  \type[option=xml]{<ans/>}
  \type[option=xml]{<aáñs/>}
  \stopTEXpage
  \stoptext

Many thanks for your help,

Pablo
--- scite-context-lexer-xml.lua	2022-06-01 17:24:38.625976000 +0200
+++ context/tex/texmf-context/context/data/scite/context/lexers/scite-context-lexer-xml.lua	2022-06-02 16:37:30.112824947 +0200
@@ -13,7 +13,7 @@
 -- todo: parse entities in attributes
 
 local global, string, table, lpeg = _G, string, table, lpeg
-local P, R, S, C, Cmt, Cp = lpeg.P, lpeg.R, lpeg.S, lpeg.C, lpeg.Cmt, lpeg.Cp
+local P, R, S, C, Cmt, Cp, lpatterns = lpeg.P, lpeg.R, lpeg.S, lpeg.C, lpeg.Cmt, lpeg.Cp, lpeg.patterns
 local type = type
 local match, find = string.match, string.find
 
@@ -41,7 +41,8 @@
 local equal            = P("=")
 local ampersand        = P("&")
 
-local name             = (R("az","AZ","09") + S("_-."))^1
+local alsoname         = lpatterns.utf8two + lpatterns.utf8three + lpatterns.utf8four
+local name             = (R("az","AZ","09") + S("_-.") + alsoname)^1
 local openbegin        = P("<")
 local openend          = P("</")
 local closebegin       = P("/>") + P(">")
_______________________________________________
dev-context mailing list
dev-context@ntg.nl
https://mailman.ntg.nl/mailman/listinfo/dev-context

Reply via email to