# Path: crosscompute/macros/web.py
# def format_slug(text):
#     return normalize_key(text, word_separator='-')
# 
# def get_html_from_markdown(text):
#     html = markdown(text)
#     if '</p>\n<p>' not in html:
#         html = html.removeprefix('<p>')
#         html = html.removesuffix('</p>')
#     return html


from crosscompute.macros.web import (
    format_slug,
    get_html_from_markdown)


def test_format_slug():
    assert format_slug('a b,c') == 'a-b-c'


def test_get_html_from_markdown():
    html = get_html_from_markdown('x')
    assert not html.startswith('<p>') and not html.endswith('</p>')

# Path: crosscompute/macros/web.py
# def format_slug(text):
#     return normalize_key(text, word_separator='-')
# 
# def get_html_from_markdown(text):
#     html = markdown(text)
#     if '</p>\n<p>' not in html:
#         html = html.removeprefix('<p>')
#         html = html.removesuffix('</p>')
#     return html


# Path: tests/test_macros_web.py
from crosscompute.macros.web import (
    format_slug,
    get_html_from_markdown)



def test_format_slug():
    assert format_slug('a b,c') == 'a-b-c'


def test_get_html_from_markdown():
    html = get_html_from_markdown('x')
    assert not html.startswith('<p>') and not html.endswith('</p>')

    html = get_html_from_markdown('x\n\nx')