Skip to content

Add code pasting support#1159

Merged
acywatson merged 3 commits intopost-transformfrom
code-pasting-tests
Jan 22, 2022
Merged

Add code pasting support#1159
acywatson merged 3 commits intopost-transformfrom
code-pasting-tests

Conversation

@fantactuka
Copy link
Copy Markdown
Collaborator

@fantactuka fantactuka commented Jan 21, 2022

Added some e2e tests for different editors / text surfaces (VSCode, Codehub, Webstorm, Slack, Notion) with basic code detection (for now it's font-family: monospace that seem to be common). The only outlier is Github which outputs code with <table> and will require special handling logic if we decide to support it

Kapture 2022-01-21 at 16 10 41

@fantactuka fantactuka requested a review from acywatson January 21, 2022 21:11
@vercel
Copy link
Copy Markdown

vercel bot commented Jan 21, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/fbopensource/lexical/EANJ4v4WaPgzuGcw5R84QcPWcWma
✅ Preview: https://lexical-git-code-pasting-tests-fbopensource.vercel.app

@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 Jan 21, 2022
@fantactuka fantactuka changed the title Add code detecting and e2e tests Add code pasting support Jan 21, 2022
@fantactuka
Copy link
Copy Markdown
Collaborator Author

Fixes #1042

@fantactuka
Copy link
Copy Markdown
Collaborator Author

Added GH table-based markup support, which does not look that bad code-wise with new API

Copy link
Copy Markdown
Contributor

@acywatson acywatson left a comment

Choose a reason for hiding this comment

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

Looks great, thanks!

@acywatson acywatson merged this pull request into post-transform Jan 22, 2022
@fantactuka fantactuka deleted the code-pasting-tests branch January 22, 2022 02:11
acywatson pushed a commit that referenced this pull request Jan 22, 2022
* Add code detecting and e2e tests

* Add quip paste

* Add github table-based code pasting
acywatson added a commit that referenced this pull request Jan 22, 2022
…sting (#1153)

* wip

* wip

* add postTransform to HTML paste logic

* Add code pasting support (#1159)

* Add code detecting and e2e tests

* Add quip paste

* Add github table-based code pasting

* remove dom node from post-processor signature

* fix rebase issue

Co-authored-by: Maksim Horbachevsky <fantactuka@gmail.com>
acywatson pushed a commit that referenced this pull request Jan 30, 2022
* Add code detecting and e2e tests

* Add quip paste

* Add github table-based code pasting
acywatson added a commit that referenced this pull request Jan 31, 2022
…nature (#1160)

* wip

* wip

* add postTransform to HTML paste logic

* Add code pasting support (#1159)

* Add code detecting and e2e tests

* Add quip paste

* Add github table-based code pasting

* Change post-transform API to accomodate changing the currentLexicalNode

* simplify function signature in HTMl paste post-processor

* rebase fixes

Co-authored-by: Maksim Horbachevsky <fantactuka@gmail.com>
acywatson added a commit that referenced this pull request Apr 9, 2022
…sting (#1153)

* wip

* wip

* add postTransform to HTML paste logic

* Add code pasting support (#1159)

* Add code detecting and e2e tests

* Add quip paste

* Add github table-based code pasting

* remove dom node from post-processor signature

* fix rebase issue

Co-authored-by: Maksim Horbachevsky <fantactuka@gmail.com>
acywatson added a commit that referenced this pull request Apr 9, 2022
…nature (#1160)

* wip

* wip

* add postTransform to HTML paste logic

* Add code pasting support (#1159)

* Add code detecting and e2e tests

* Add quip paste

* Add github table-based code pasting

* Change post-transform API to accomodate changing the currentLexicalNode

* simplify function signature in HTMl paste post-processor

* rebase fixes

Co-authored-by: Maksim Horbachevsky <fantactuka@gmail.com>
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