Issue #28 new

nl2br works wrong

Anonymous created an issue

when i do nl2br(some string with \r\n newline from textarea) nl2br affects only the first \r, the \n is passed to the function output

Comments (1)

  1. Mike Orr

    I'm not sure what to do here. It's running it through a universal newline substitution, which should convert all of these to \n. It's defined as:

    _universal_newline_rx = re.compile(R"\r\n|\n|\r")  # All types of newline.
    

    Can you try removing the "R" prefix, or adding "|\n\t" to the expression and see if that fixes it for you?

  2. Log in to comment