Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fixed kg-html-to-lexical creating unwanted text alignment and invalid nesting #1002

Merged
merged 11 commits into from
Oct 19, 2023

Commits on Oct 19, 2023

  1. 🐛 Fixed kg-html-to-lexical creating unwanted text alignment and inv…

    …alid nesting
    
    refs TryGhost/Ghost#18448
    
    - extracted our aligment stripping and denesting transforms to a new `kg-default-transforms` package
    - updated `kg-html-to-lexical` so it adds the transforms to the headless editor ensuring the output matches what we'd get if the same content was pasted directly into the editor
    kevinansfield committed Oct 19, 2023
    Configuration menu
    Copy the full SHA
    cb5ba7b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4c80181 View commit details
    Browse the repository at this point in the history
  3. updated denest transform to handle nesting inside lists, removed imag…

    …e-specific denest in koenig-lexical
    kevinansfield committed Oct 19, 2023
    Configuration menu
    Copy the full SHA
    67759d8 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ebd41f1 View commit details
    Browse the repository at this point in the history
  5. update comments

    kevinansfield committed Oct 19, 2023
    Configuration menu
    Copy the full SHA
    ade6825 View commit details
    Browse the repository at this point in the history
  6. switched back to commonjs build type, fixed kg-html-to-lexical tests

    - with module build type we ran into issues when imported into commonjs package builds
    - with commonjs build type we need to explicitly import in koenig-lexical vite config
    kevinansfield committed Oct 19, 2023
    Configuration menu
    Copy the full SHA
    c0b475e View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    97e4d5d View commit details
    Browse the repository at this point in the history
  8. fixed registerDefaultTransforms test

    - extracted editor creation to test utils ready for re-use in individual transform tests
    - transforms are not run when using `setEditorState()` so we need to register them after that as they _are_ run when registering
    - we can't use `getEditorState()` immediately after registering transforms because they are still being run async, we can get around that by running an empty discrete update first
    kevinansfield committed Oct 19, 2023
    Configuration menu
    Copy the full SHA
    bec73df View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    a67707c View commit details
    Browse the repository at this point in the history
  10. 100% test coverage

    kevinansfield committed Oct 19, 2023
    Configuration menu
    Copy the full SHA
    a22bb5b View commit details
    Browse the repository at this point in the history
  11. fixed linting

    kevinansfield committed Oct 19, 2023
    Configuration menu
    Copy the full SHA
    6589345 View commit details
    Browse the repository at this point in the history