def linebreaks_safe(value, autoescape=True):
    """
    Adds linebreaks only for text that has a newline character.
    """
    if isinstance(value, string_types) and '\n' in value:
        return linebreaks_filter(value, autoescape=autoescape)

    return value
def linebreaks_safe ( value , autoescape = True ) : if isinstance ( value , string_types ) and '\n' in value : return linebreaks_filter ( value , autoescape = autoescape ) return value
Adds linebreaks only for text that has a newline character.