From 8ba94957c6f7c78441e6feb98ca5cd4813f32be6 Mon Sep 17 00:00:00 2001 From: amorphobia Date: Tue, 15 Oct 2024 17:09:26 +0800 Subject: [PATCH] feat: use "uu" for unicode --- schema/jiandao.schema.yaml | 2 +- schema/lua/jiandao/unicode_translator.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/schema/jiandao.schema.yaml b/schema/jiandao.schema.yaml index d1f77c2..6259ff6 100644 --- a/schema/jiandao.schema.yaml +++ b/schema/jiandao.schema.yaml @@ -166,7 +166,7 @@ recognizer: danzi_lookup: "[a-z`]*`+[a-z`]*" punct: "^/([0-9]0?|[a-z]+)$" calc: "^=[^;']+$" - unicode: "^u`[0-9a-f]*$" + unicode: "^uu[0-9a-f]*$" topup: __include: "layout/topup" diff --git a/schema/lua/jiandao/unicode_translator.lua b/schema/lua/jiandao/unicode_translator.lua index 29c5ff3..01d192f 100644 --- a/schema/lua/jiandao/unicode_translator.lua +++ b/schema/lua/jiandao/unicode_translator.lua @@ -17,7 +17,7 @@ --]] local function translator(input, seg) - local delimiter = string.find(input, "u`") + local delimiter = string.find(input, "uu") if delimiter ~= nil then local input_code = string.sub(input, delimiter + 2) local codepoint = tonumber(input_code, 16)