A Python parser for MediaWiki wikicode https://mwparserfromhell.readthedocs.io/
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

12 行
578 B

  1. name: empty
  2. label: sanity check that parsing an empty string yields nothing
  3. input: ""
  4. output: []
  5. ---
  6. name: rich_heading
  7. label: a heading with templates/wikilinks in it
  8. input: "== Head{{ing}} [[with]] {{{funky|{{stuf}}}}} =="
  9. output: [HeadingStart(level=2), Text(text=" Head"), TemplateOpen(), Text(text="ing"), TemplateClose(), Text(text=" "), WikilinkOpen(), Text(text="with"), WikilinkClose(), Text(text=" "), ArgumentOpen(), Text(text="funky"), ArgumentSeparator(), TemplateOpen(), Text(text="stuf"), TemplateClose(), ArgumentClose(), Text(text=" "), HeadingEnd()]