If a paragraph is empty, <br/> in the end should not be stripped:

test


test




If a paragraph is not empty, <br/> in the end should be stripped:

test

non-empty

test




If a paragraph is not empty, only the last <br/> in the end should be stripped:

test

non-empty

test




Nothing is stripped in the start of a paragraph:

test


non-empty


test