Browse Source

Caveats -> Limitations, add Config unawareness

tags/v0.5
Larivact 6 years ago
committed by GitHub
parent
commit
4d4a25152e
1 changed files with 18 additions and 5 deletions
  1. +18
    -5
      README.rst

+ 18
- 5
README.rst View File

@@ -113,20 +113,20 @@ saving the page!) by calling ``str()`` on it::

Likewise, use ``unicode(code)`` in Python 2.

Caveats
Limitations
-----------
While the MediaWiki parser generates HTML, mwparserfromhell acts as an interface to
the source code. mwparserfromhell therefore is unaware of template definitions since
if it would substitute templates with their output you could no longer change the templates.
This has several implications:
if it would substitute templates with their output you would no longer be working
with the source code. This has several implications:

* Start and end tags generated by templates aren't recognized e.g. ``<b>foobar{{bold-end}}``.

* Templates adjacent to external links e.g. ``http://example.com{{foo}}`` are
considered part of the link.

* Crossed constructs like ``{{echo|''Hello}}, world!''`` are not supported.
We compromise by treating the first node as plain text.
* Crossed constructs like ``{{echo|''Hello}}, world!''`` are not supported,
the first node is treated as plain text.

The current workaround for cases where you are not interested in text
formatting is to pass ``skip_style_tags=True`` to ``mwparserfromhell.parse()``.
@@ -135,6 +135,17 @@ This has several implications:
A future version of mwparserfromhell will include multiple parsing modes to get
around this restriction.

Configuration unawareness
-------------------------

* `word-ending links`_ are not supported since the linktrail rules are language-specific.

* Localized namespace names aren't recognized, e.g. ``[[File:...]]``
links are treated as regular wikilinks.

* Anything that looks like an XML tag is parsed as a tag since,
the available tags are extension-dependent.

Integration
-----------

@@ -178,6 +189,7 @@ Python 3 code (via the API_)::
.. _GitHub: https://github.com/earwig/mwparserfromhell
.. _Python Package Index: http://pypi.python.org
.. _get pip: http://pypi.python.org/pypi/pip
.. _word-ending links: https://www.mediawiki.org/wiki/Help:Links#linktrail
.. _EarwigBot: https://github.com/earwig/earwigbot
.. _Pywikibot: https://www.mediawiki.org/wiki/Manual:Pywikibot
.. _API: http://mediawiki.org/wiki/API

Loading…
Cancel
Save