Tested in Firefox:
hello|CARET|) then Enter creates hell|CARET|o(newline))
(hi|CARET|) then Enter creates (h|CARET|i(newline))
(h|CARET|) then Enter creates (|CARET|h(newline))
|CARET|) then Enter creates )|CARET|
All should create the initial text, but with a newline then caret where the caret used to be.
Tested in Firefox:
hello|CARET|)then Enter createshell|CARET|o(newline))(hi|CARET|)then Enter creates(h|CARET|i(newline))(h|CARET|)then Enter creates(|CARET|h(newline))|CARET|)then Enter creates)|CARET|All should create the initial text, but with a newline then caret where the caret used to be.