def newlines_filter(value: str) -> str:
    """
    Convert newlines to <br /> for displaying on browser.
    """
    if isinstance(value, str):
        return value.replace('\n', '<br />')
    return value