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)
- And more examples at mw:Writing systems/Syntax. GnolizX(留言) 2022年9月20日 (二) 02:36 (UTC)