# Path: blog/markup.py
# def markup(text: str) -> str:
#     """
#     Mark up plain text into fancy HTML.
# 
#     """
#     return typogrify(
#         markdown(
#             text,
#             output_format="html5",
#             extensions=["abbr", "codehilite", "fenced_code", "sane_lists"],
#         )
#     )


from django import template
from django.template.defaultfilters import stringfilter
from django.utils.safestring import mark_safe
from ..markup import markup as markup_func



register = template.Library()


@register.filter
@stringfilter
def markup(value: str) -> str:

# Path: blog/markup.py
# def markup(text: str) -> str:
#     """
#     Mark up plain text into fancy HTML.
# 
#     """
#     return typogrify(
#         markdown(
#             text,
#             output_format="html5",
#             extensions=["abbr", "codehilite", "fenced_code", "sane_lists"],
#         )
#     )


# Path: blog/templatetags/markup.py
from django import template
from django.template.defaultfilters import stringfilter
from django.utils.safestring import mark_safe
from ..markup import markup as markup_func




register = template.Library()


@register.filter
@stringfilter
def markup(value: str) -> str:

    return mark_safe(markup_func(value))