markdown-link-style

switch between inline and footnote link style in markdown documents.
git clone git://git.ricketyspace.net/markdown-link-style.git
Log | Files | Refs

commit 2fcde808761b80577231e61f89d35e64a6c5dffb
parent 72d9e150b73d43838cba0292de5b4f7c63219fef
Author: rsiddharth <s@ricketyspace.net>
Date:   Thu, 23 Feb 2017 01:15:06 +0000

mdl_style: Update `LSMarkdown` class.

Reset renderer's footnote link related variables each time text is
parsed with the `LSMarkdown.parse` method.

* markdown_link_style/_version.py (__version__): Update variable.
* mdl_style.py (LSMarkdown.parse): Update method.

Diffstat:
markdown_link_style/_version.py | 2+-
mdl_style.py | 8+++++++-
2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/markdown_link_style/_version.py b/markdown_link_style/_version.py @@ -18,4 +18,4 @@ # along with markdown-link-style (see COPYING). If not, see # <http://www.gnu.org/licenses/>. -__version__ = '0.1.0.dev4' +__version__ = '0.1.0.dev5' diff --git a/mdl_style.py b/mdl_style.py @@ -181,7 +181,7 @@ class LSRenderer(Renderer): for ref in self.fn_lnk_refs: refs += '{}\n'.format(ref) - # empty fn_lnk_refs + # Empty fn_lnk_refs self.fn_lnk_refs = [] return refs @@ -204,8 +204,14 @@ class LSMarkdown(Markdown): super(LSMarkdown, self).__init__(renderer, inline, block, **kwargs) def parse(self, text): + # Reset footnote link variables. + self.renderer.fn_lnk_num = 0 + self.renderer.fn_lnk_refs = [] + + # Parse text. out = super(LSMarkdown, self).parse(text) + # Spit out. return out.lstrip('\n')