A Python parser for MediaWiki wikicode https://mwparserfromhell.readthedocs.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

18 lines
798 B

  1. Caveats
  2. =======
  3. An inherent limitation in wikicode prevents us from generating complete parse
  4. trees in certain cases. For example, the string ``{{echo|''Hello}}, world!''``
  5. produces the valid output ``<i>Hello, world!</i>`` in MediaWiki, assuming
  6. ``{{echo}}`` is a template that returns its first parameter. But since
  7. representing this in mwparserfromhell's node tree would be impossible, we
  8. compromise by treating the first node (i.e., the template) as plain text,
  9. parsing only the italics.
  10. The current workaround for cases where you are not interested in text
  11. formatting is to pass *skip_style_tags=True* to :func:`mwparserfromhell.parse`.
  12. This treats ``''`` and ``'''`` like plain text.
  13. A future version of mwparserfromhell will include multiple parsing modes to get
  14. around this restriction.