We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 956f499 commit f318746Copy full SHA for f318746
build.py
@@ -180,7 +180,14 @@ def main():
180
assert patch.校正字頭, (
181
f'patching 小韻 #{原書小韻號}/{小韻字號} 字 "{patch.原字頭}", but 校正字頭 is missing'
182
)
183
- # TODO verify `patch.校正字頭`
+ if patch.校正字頭.startswith('['):
184
+ assert re.fullmatch(r'\[.+/.+\]', patch.校正字頭), (
185
+ f'invalid 校正字頭: "{patch.校正字頭}"'
186
+ )
187
+ if '~' in patch.校正字頭:
188
+ assert not 字頭.startswith('['), (
189
+ f'cannot use "~" in 校正字頭 when 字頭 contains correction: "{字頭}"'
190
191
字頭 = patch.校正字頭.replace('~', 字頭)
192
if 字頭.endswith('/-]'):
193
字頭當刪 = patch.當刪說明 or '當刪'
0 commit comments