跳转到内容

Module talk:Headword

页面内容不支持其他语言。
添加话题
維基詞典,自由的多語言詞典
最新留言:Public class在1年前发布在话题Line 162

Line 162[编辑]

Revision https://cd.100ke.info/w/index.php?title=Module:Headword&diff=5857604&oldid=5848702 added "-{" and "}-" around the head string in line 162. Even though these strings don't appear on the webpage but they do appear in the expended Template text in the https://github.com/tatuylonen/wikitextprocessor tool. I don't have the permission to edit this page, I hope someone could edit this line and remove the "-{" and "}-". Public class留言2022年9月20日 (二) 01:32 (UTC)回复

Hello, @Public class, "-{" and "}-" are necessary as we need them to suppress the MediaWiki's built-in simplified-traditional Chinese conversion so that the headlines stay intact. For example, without them text "Adam’s apple" would be incorrectly converted to "Adam』s apple" when using the traditional variant of Chinese in some cases, among many other unexpected incorrect outcomes. "-{" and "}-" could be easily removed using the following code in Python.
name = "-{good}-"
myRe = re.compile(r"-\{(.*)\}-")
name = re.findall(myRe, name)[0]
or maybe even
name = "-{good}-"
name = name.replace("-{", "").replace("}-", "")
-Hzy980512留言2022年9月20日 (二) 02:24 (UTC)回复
And more examples at mw:Writing systems/Syntax. GnolizX留言2022年9月20日 (二) 02:36 (UTC)回复
Dang, I thought it was a mistake since I didn't find this syntax in the wikitext help page. Thanks for your help! Public class留言2022年9月20日 (二) 03:40 (UTC)回复