Repository navigation
Conversation
ohnishant
left a comment
There was a problem hiding this comment.
Two things I want to flag before this lands.
First, the Enter handler does not check e.isComposing. When someone uses an IME, pressing Enter confirms the composition, and our preventDefault() plus newline insert would break that. I think we should add an early return for e.isComposing.
Second, the empty-editor sentinel in editorSource is tightly scoped. It only catches a single <br> or a single <div><br></div>. That is enough for the browser behavior I saw in testing, but if a browser leaves multiple empty block elements, we would still read a stray newline. Since we rebuild the DOM with buildEditorFragment on every edit, this is probably fine, but it is a narrow guard.
I will push a small follow-up for the IME case.
|
Superseded by #38. I had to rename the branch to follow the repo convention, so GitHub required a new PR. |
Summary
Issues
Closes #35
Closes #36
Verification
go test ./...go vet ./...gofmt -l .The two fixes are separate commits so each issue can be reviewed independently.