Skip to content

Tidy up and make event inputs simpler - #133

Merged
trueadm merged 2 commits into
mainfrom
improve-outline-event-inputs
Feb 25, 2021
Merged

trueadm merged 2 commits into
mainfrom
improve-outline-event-inputs

Conversation

@trueadm

@trueadm trueadm commented Feb 25, 2021

Copy link
Copy Markdown
Collaborator

This PR attempts to do three things:

  • simplify input event logic so that it's easier to understand
  • improve the flow typing of the input event handlers
  • reduce the overhead and code size of the module

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 25, 2021

@zurfyx zurfyx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense to me, so instead of having the focus in event we start with a full-fledged editor that's prepared to write instead of postponing the initial nodes population

const pluginStateRef = useRef<{
isReadOnly: boolean,
const pluginState = useMemo(() => ({
isReadOnly: false,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we get rid of this prop? (same in the RichText file)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be used, we just don't use it.

@trueadm
trueadm merged commit 24b0fda into main Feb 25, 2021
@trueadm
trueadm deleted the improve-outline-event-inputs branch February 25, 2021 15:40
acywatson pushed a commit that referenced this pull request Apr 9, 2022
* Tidy up and make event inputs simpler

* Clean up some bits
etrepum pushed a commit to etrepum/lexical that referenced this pull request Oct 30, 2026
…s raw beside markers

## Description

A reference for a control character (U+0001 to U+001F, U+007F to U+009F) or a noncharacter reads back as U+FFFD (or `…` for `&meta#133;`) in markdown-it and HTML decoders, so the export no longer writes one for them; they stay raw as on main. `canEmphasis` reads the characters around a delimiter once for both its open and close answers, and `isPunctuationOrSpace` replaces the third hand-written character class.

## Test plan

`./node_modules/.bin/vitest run --project unit packages/lexical-markdown`

### After

```
 Test Files  9 passed (9)
      Tests  872 passed (872)
```

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants