Template text:

$first $second REMOVED Inside a tag Outside a tag

$first $second NOT REMOVED Inside a tag Outside a tag

$first $second NOT REMOVED Inside a tag

$first $second NOT REMOVED Inside a tag Outside a tag

$first $second NOT REMOVED

$first $second NOT REMOVED

Extracted messages: (4, None, u'%(first)s [1:%(second)s] REMOVED [2:Inside a tag] Outside a tag', []) (8, None, u'NOT REMOVED', []) (8, None, u'Inside a tag', []) (8, None, u'Outside a tag', []) (10, None, u'%(first)s [1:%(second)s] NOT REMOVED [2:Inside a tag]', []) (13, None, u'[1:%(first)s] [2:%(second)s] NOT REMOVED [3:Inside a tag] Outside a tag', []) (16, None, u'%(first)s [1:%(second)s] NOT REMOVED', []) (19, None, u'[1:%(first)s] [2:%(second)s] NOT REMOVED', []) Generated XHTML:

FIRST SECONDInside a tag Outside a tag

FIRST SECOND NOT REMOVED Inside a tag Outside a tag

FIRST SECOND NOT REMOVED Inside a tag

FIRST SECOND NOT REMOVED Inside a tag Outside a tag

FIRST SECOND NOT REMOVED

FIRST SECOND NOT REMOVED