Skip to content

Commit

Permalink
chore: document white-space fix for firefox
Browse files Browse the repository at this point in the history
Came across this while I tried to use the input. Took me a while to figure out why it wasn't behaving like on https://loogle.lean-lang.org/, so I think the fix should be documented.
  • Loading branch information
jakobvase authored Jan 26, 2025
1 parent 3f499d0 commit 1fb9c3a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lean4-unicode-input-component/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
1. Add a new `contenteditable` div to your HTML that serves as the input: `<div id="unicode-input" contenteditable="true"></div>`
2. Import `InputAbbreviationRewriter` from this package and create a new `InputAbbreviationRewriter` for `#unicode-input`
3. Make sure to call `InputAbbreviationRewriter.resetAbbreviations` whenever setting the text of `#unicode-input` programmatically, as the `InputAbbreviationRewriter` only triggers on actual user input
4. Style `#unicode-input` to your liking
4. Add `white-space: -moz-pre-space` to `#unicode-input`, otherwise there's an error with multiple spaces on Firefox.
5. Style `#unicode-input` to your liking

This component only supports single-line input and no rich text styling other than the abbreviation highlighting.

0 comments on commit 1fb9c3a

Please sign in to comment.