Question: How can I change the default behavior in the markdown filter so that it transforms a newline to a br tag?

Answer: 
You can override default MARKDOWN\_DEUX\_STYLES with adding `"break-on-newline": True` in `extras` settings :

```
MARKDOWN_DEUX_STYLES = {
    "default": {
        "extras": {
            "code-friendly": None,
            "break-on-newline": True,
        },
        "safe_mode": "escape",
    }
}

```

[Documentation](https://github.com/trentm/python-markdown2/wiki/Extras) of python-markdown2:

> 
> break-on-newline: Replace single new line characters with   
>  when
>  True.
> 
> 
>
You could write a [custom filter](http://docs.djangoproject.com/en/dev/howto/custom-template-tags/) that calls markdown, then does [replace](http://docs.python.org/library/stdtypes.html#str.replace) on its output.