def test_before_after_1(assert_same_renderings):
    assert_same_renderings(
        '''
            <style>
                @page { size: 300px 30px }
                body { margin: 0 }
                a[href]:before { content: '[' attr(href) '] ' }
            </style>
            <p><a href="some url">some content</a></p>
        ''',
        '''
            <style>
                @page { size: 300px 30px }
                body { margin: 0 }
            </style>
            <p><a href="another url"><span>[some url] </span>some content</p>
        ''', tolerance=10)
<style>
@page { size: 300px 30px }
body { margin: 0 }
a[href]:before { content: '[' attr(href) '] ' }
</style>
<p><a href="some url">some content</a></p>
''',
tests/draw/test_before_after.py