<document source="test data">
    <paragraph>
        An if directive in substitution definition whose content returns an error.
    <system_message level="1" line="3" source="test data" type="INFO">
        <paragraph>
            No directive entry for "if" in module "Text::Restructured::Directive".
            Trying "if" as canonical directive name.
    <system_message level="4" line="2" source="if directive at test data, line 3" type="SEVERE">
        <paragraph>
            Unexpected section title.
        <literal_block xml:space="preserve">
            Bogus header
            ============
    <system_message level="3" line="3" source="test data" type="ERROR">
        <paragraph>
            Error in "if" directive within substitution definition: may contain a single paragraph only.
    <system_message level="2" line="3" source="test data" type="WARNING">
        <paragraph>
            Substitution definition "error" empty or invalid.
        <literal_block xml:space="preserve">
            .. |error| if:: 1
            \n\
               Bogus header
               ============
