# -*- coding: utf-8 -*- """ Python Markdown A Python implementation of John Gruber's Markdown. Documentation: https://python-markdown.github.io/ GitHub: https://github.com/Python-Markdown/markdown/ PyPI: https://pypi.org/project/Markdown/ Started by Manfred Stienstra (http://www.dwerg.net/). Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org). Currently maintained by Waylan Limberg (https://github.com/waylan), Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser). Copyright 2007-2018 The Python Markdown Project (v. 1.7 and later) Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) Copyright 2004 Manfred Stienstra (the original version) License: BSD (see LICENSE.md for details). """ from markdown.test_tools import TestCase class TestAbbr(TestCase): default_kwargs = {'extensions': ['abbr']} def test_abbr_upper(self): self.assertMarkdownRenders( self.dedent( """ ABBR *[ABBR]: Abbreviation """ ), self.dedent( """

ABBR

""" ) ) def test_abbr_lower(self): self.assertMarkdownRenders( self.dedent( """ abbr *[abbr]: Abbreviation """ ), self.dedent( """

abbr

""" ) ) def test_abbr_multiple(self): self.assertMarkdownRenders( self.dedent( """ The HTML specification is maintained by the W3C. *[HTML]: Hyper Text Markup Language *[W3C]: World Wide Web Consortium """ ), self.dedent( """

The HTML specification is maintained by the W3C.

""" ) ) def test_abbr_override(self): self.assertMarkdownRenders( self.dedent( """ ABBR *[ABBR]: Ignored *[ABBR]: The override """ ), self.dedent( """

ABBR

""" ) ) def test_abbr_no_blank_Lines(self): self.assertMarkdownRenders( self.dedent( """ ABBR *[ABBR]: Abbreviation ABBR """ ), self.dedent( """

ABBR

ABBR

""" ) ) def test_abbr_no_space(self): self.assertMarkdownRenders( self.dedent( """ ABBR *[ABBR]:Abbreviation """ ), self.dedent( """

ABBR

""" ) ) def test_abbr_extra_space(self): self.assertMarkdownRenders( self.dedent( """ ABBR *[ABBR] : Abbreviation """ ), self.dedent( """

ABBR

""" ) ) def test_abbr_line_break(self): self.assertMarkdownRenders( self.dedent( """ ABBR *[ABBR]: Abbreviation """ ), self.dedent( """

ABBR

""" ) ) def test_abbr_ignore_unmatched_case(self): self.assertMarkdownRenders( self.dedent( """ ABBR abbr *[ABBR]: Abbreviation """ ), self.dedent( """

ABBR abbr

""" ) ) def test_abbr_partial_word(self): self.assertMarkdownRenders( self.dedent( """ ABBR ABBREVIATION *[ABBR]: Abbreviation """ ), self.dedent( """

ABBR ABBREVIATION

""" ) ) def test_abbr_unused(self): self.assertMarkdownRenders( self.dedent( """ foo bar *[ABBR]: Abbreviation """ ), self.dedent( """

foo bar

""" ) ) def test_abbr_double_quoted(self): self.assertMarkdownRenders( self.dedent( """ ABBR *[ABBR]: "Abbreviation" """ ), self.dedent( """

ABBR

""" ) ) def test_abbr_single_quoted(self): self.assertMarkdownRenders( self.dedent( """ ABBR *[ABBR]: 'Abbreviation' """ ), self.dedent( """

ABBR

""" ) )