summaryrefslogtreecommitdiff
path: root/scripts/context/ruby/base/texutil.rb
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/context/ruby/base/texutil.rb')
-rw-r--r--scripts/context/ruby/base/texutil.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/context/ruby/base/texutil.rb b/scripts/context/ruby/base/texutil.rb
index 4882404d5..063f67f2d 100644
--- a/scripts/context/ruby/base/texutil.rb
+++ b/scripts/context/ruby/base/texutil.rb
@@ -187,7 +187,14 @@ class TeXUtil
# shortcut("\\\"e", 'ediaeresis')
# shortcut("\\\'o", 'oacute')
+ def hextoutf(str)
+ str.gsub(/^(0x[A-F\d]+)$/) do
+ [$1.hex()].pack("U")
+ end
+ end
+
def shortcut(from,to)
+ from = hextoutf(from)
replacer(from,to)
expander(to)
end