def test_formatting():
    # standard line

    h = HtmlElement()
    assert _get_text(h) == 'firstEhre sei Gott!last'

    h.display = Display.block
    h.margin_before = 1
    h.margin_after = 2
    print(h)
    print(_get_text(h))
    assert _get_text(h) == 'first\n\nEhre sei Gott!\n\n\nlast'

    # list bullet without padding_inline
    h.list_bullet = "* "
    assert _get_text(h) == 'first\n\n* Ehre sei Gott!\n\n\nlast'

    # add a padding_inline
    h.padding_inline = 3
    assert _get_text(h) == 'first\n\n * Ehre sei Gott!\n\n\nlast'

    # and prefixes + suffixes
    h.prefix = '>>'
    h.suffix = '<<'
    assert  _get_text(h)== 'first\n\n * >>Ehre sei Gott!<<\n\n\nlast'
예제 #2
0
파일: css.py 프로젝트: weblyzard/inscriptis
 def attr_margin_top(value: str, html_element: HtmlElement):
     """Apply the given top margin."""
     html_element.margin_before = CssParse._get_em(value)