-
-
Notifications
You must be signed in to change notification settings - Fork 348
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
fix: can not run blocksuite's toast function when not open a page in affine #4236
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
There was a problem hiding this 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?
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*(?![^"]*",)/); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's never easy parsing a string. I suggest using libraries like papaparse.
I have created a new issue to relate the pr. @doodlewind |
close #4238
fix: can not run blocksuite's toast function when not open a page in affine
fix: ignore quotes when parsing table