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

fix: can not run blocksuite's toast function when not open a page in affine #4236

Merged

Conversation

zuoxiaodong0815
Copy link
Contributor

@zuoxiaodong0815 zuoxiaodong0815 commented Aug 20, 2023

close #4238
fix: can not run blocksuite's toast function when not open a page in affine
fix: ignore quotes when parsing table

@vercel
Copy link

vercel bot commented Aug 20, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
blocksuite ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 21, 2023 0:24am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
blocksuite-docs ⬜️ Ignored (Inspect) Visit Preview Aug 21, 2023 0:24am

Copy link
Member

@doodlewind doodlewind left a comment

Choose a reason for hiding this comment

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

Does this have related issues to close?

@zuoxiaodong0815
Copy link
Contributor Author

Does this have related issues to close?

There is no corresponding issue yet. I'll create a new issue.

@@ -174,16 +173,19 @@ export async function importNotion(workspace: Workspace, file: File) {
let id = 1;
const titles: string[] = [];
const rows: string[][] = [];
tableString?.split('\n').forEach((row, index) => {
tableString?.split(/\r\n|\r|\n/).forEach((row, index) => {
const rowArray = row.split(/,\s*(?![^"]*",)/);
Copy link
Contributor

Choose a reason for hiding this comment

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

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Separated by commas, but ignoring commas within quotes.

Copy link
Contributor

Choose a reason for hiding this comment

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

",", ",,", ""
   ^     ^

What you need to match is two, but you only match one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Replaced with this regular /,\s*(?=(?:(?:[^"]"){2})[^"]*$)/ @fourdim

Copy link
Contributor

Choose a reason for hiding this comment

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

image
It's never easy parsing a string. I suggest using libraries like papaparse.

@zuoxiaodong0815
Copy link
Contributor Author

Does this have related issues to close?

I have created a new issue to relate the pr. @doodlewind

@doodlewind doodlewind enabled auto-merge (squash) August 21, 2023 00:29
@fourdim fourdim disabled auto-merge August 21, 2023 00:30
@zuoxiaodong0815 zuoxiaodong0815 merged commit 6c9c513 into toeverything:master Aug 21, 2023
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Archived in project
Development

Successfully merging this pull request may close these issues.

Browser error after importing notion database
3 participants