B
Ben Eveling
I've developed a basic font formatter using a textarea in Win IE6,
textrange and regular expressions. It's fine in most cases except as
follows:
If I make a selection which includes the newline at the end of a line,
but nothing from the line following it, I cannot get JavaScript to
recognise the newline as existing. Consequently, when I add the
formatting tags, the newline is deleted as though it had never existed.
Obviously users can simply go to the end of the line and not include the
newline, but I am trying to make the app as idiot-proof as possible.
Has anyone come across missing newlines like this before? Thanks in
advance for any help.
textrange and regular expressions. It's fine in most cases except as
follows:
If I make a selection which includes the newline at the end of a line,
but nothing from the line following it, I cannot get JavaScript to
recognise the newline as existing. Consequently, when I add the
formatting tags, the newline is deleted as though it had never existed.
Obviously users can simply go to the end of the line and not include the
newline, but I am trying to make the app as idiot-proof as possible.
Has anyone come across missing newlines like this before? Thanks in
advance for any help.