Browse Source

Update changelog, docs.

tags/v0.4
Ben Kurtovic 10 years ago
parent
commit
b4b62026f8
4 changed files with 16 additions and 8 deletions
  1. +4
    -0
      CHANGELOG
  2. +4
    -0
      docs/changelog.rst
  3. +7
    -0
      mwparserfromhell/parser/__init__.py
  4. +1
    -8
      mwparserfromhell/utils.py

+ 4
- 0
CHANGELOG View File

@@ -2,6 +2,10 @@ v0.4 (unreleased):


- Added a script to test for memory leaks in scripts/memtest.py. - Added a script to test for memory leaks in scripts/memtest.py.
- Added a script to do releases in scripts/release.sh. - Added a script to do releases in scripts/release.sh.
- skip_style_tags can now be passed to mwparserfromhell.parse() (previously,
only Parser().parse() allowed it).
- Fixed a parser bug involving nested tags.
- Updated and fixed some documentation.


v0.3.3 (released April 22, 2014): v0.3.3 (released April 22, 2014):




+ 4
- 0
docs/changelog.rst View File

@@ -9,6 +9,10 @@ Unreleased


- Added a script to test for memory leaks in :file:`scripts/memtest.py`. - Added a script to test for memory leaks in :file:`scripts/memtest.py`.
- Added a script to do releases in :file:`scripts/release.sh`. - Added a script to do releases in :file:`scripts/release.sh`.
- *skip_style_tags* can now be passed to :py:func:`mwparserfromhell.parse()
<.parse_anything>` (previously, only :py:meth:`.Parser.parse` allowed it).
- Fixed a parser bug involving nested tags.
- Updated and fixed some documentation.


v0.3.3 v0.3.3
------ ------


+ 7
- 0
mwparserfromhell/parser/__init__.py View File

@@ -56,6 +56,13 @@ class Parser(object):
def parse(self, text, context=0, skip_style_tags=False): def parse(self, text, context=0, skip_style_tags=False):
"""Parse *text*, returning a :py:class:`~.Wikicode` object tree. """Parse *text*, returning a :py:class:`~.Wikicode` object tree.


If given, *context* will be passed as a starting context to the parser.
This is helpful when this function is used inside node attribute
setters. For example, :py:class:`~.ExternalLink`\ 's
:py:attr:`~.ExternalLink.url` setter sets *context* to
:py:mod:`contexts.EXT_LINK_URI <.contexts>` to prevent the URL itself
from becoming an :py:class:`~.ExternalLink`.

If *skip_style_tags* is ``True``, then ``''`` and ``'''`` will not be If *skip_style_tags* is ``True``, then ``''`` and ``'''`` will not be
parsed, but instead will be treated as plain text. parsed, but instead will be treated as plain text.
""" """


+ 1
- 8
mwparserfromhell/utils.py View File

@@ -45,14 +45,7 @@ def parse_anything(value, context=0, skip_style_tags=False):
:py:class:`~.Template`, such as :py:meth:`wikicode.insert() :py:class:`~.Template`, such as :py:meth:`wikicode.insert()
<.Wikicode.insert>` or setting :py:meth:`template.name <.Template.name>`. <.Wikicode.insert>` or setting :py:meth:`template.name <.Template.name>`.


If given, *context* will be passed as a starting context to the parser.
This is helpful when this function is used inside node attribute setters.
For example, :py:class:`~.ExternalLink`\ 's :py:attr:`~.ExternalLink.url`
setter sets *context* to :py:mod:`contexts.EXT_LINK_URI <.contexts>` to
prevent the URL itself from becoming an :py:class:`~.ExternalLink`.

If *skip_style_tags* is ``True``, then ``''`` and ``'''`` will not be
parsed, but instead will be treated as plain text.
Additional arguments are passed directly to :py:meth:`.Parser.parse`.
""" """
from .parser import Parser from .parser import Parser
from .wikicode import Wikicode from .wikicode import Wikicode


Loading…
Cancel
Save