Test coverage report: markupmirror.markup.markdown_

# markupmirror.markup.markdown_: 22 total statements, 100.0% covered

Generated: Wed 2012-04-11 05:19 CDT

Source file: /home/buechler/Sites/django-markupmirror/markupmirror/markup/markdown_.py

Stats: 14 executed, 0 missed, 8 excluded, 19 ignored

1. `import logging`
2. ``
3. `from django.utils.translation import ugettext_lazy as _`
4. ``
5. `from markupmirror import settings`
6. `from markupmirror.markup.base import BaseMarkup`
7. `from markupmirror.markup.base import register_markup`
8. ``
9. ``
10. `class MarkdownMarkup(BaseMarkup):`
11. `"""Markup transformer for Markdown content.`
12. ``
13. `"""`
14. `codemirror_mode = 'text/x-markdown'`
15. `title = _(u"Markdown")`
16. ``
17. `def __init__(self):`
18. `self.extensions = settings.MARKDOWN_EXTENSIONS`
19. `self.output_format = settings.MARKDOWN_OUTPUT_FORMAT`
20. `self.markdown = Markdown(`
21. `extensions=self.extensions,`
22. `output_format=self.output_format)`
23. ``
24. `def convert(self, markup):`
25. `return self.markdown.convert(markup)`
26. ``
27. ``
28. `# Only register if Markdown is installed`
29. `try:`
30. `from markdown import Markdown`
31. `register_markup(MarkdownMarkup)`
32. ``
33. `# logging handler for markdown`
34. `logger = logging.getLogger('MARKDOWN')`
35. `logger.addHandler(logging.StreamHandler())`
36. ``
37. `except ImportError:`
38. `pass`
39. ``
40. ``
41. `__all__ = ('MarkdownMarkup',)`