Input:

A
B
C
D

E
[LF]
F
[LF]
G
[CR]
H
[CR]
I[LF]

J[LF]

K[CR]

L[CR]

M[LF]
N[CR]
O[CR][LF]
P[LF]
[CR]
Q

Rendered view:

A
B
C
D

E
F

G
H

I

J

K

L

M
N
O
P

Q

Characters in the DOM:

A
B
C
D

E
F

G
H

I

J

K

L

M
N
O
P

Q