-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Desktop: Resolves #11575: Remove "URI malformed" alert #11576
base: dev
Are you sure you want to change the base?
Conversation
We can also log it with |
Thanks for the pr. Is there not a built-in logger in importers with this.logger? (Sorry don't have the code in front of me) |
There isn't such a logger in |
No that's fine, no need to add it in this case. But we have a test file - any chance you could add a test based on it? |
The malformed URI component is from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Malformed_URI#decoding The new test fails on commit 2b43a9a
@laurent22 So I don't even need to log the
I've added it in commit d577ea9. The new test fails on the current |
@laurent22 I've removed the logger. |
|
||
if (isDataUrl(link)) { | ||
// Just leave it as it is. We could potentially import | ||
// it as a resource but for now that's good enough. | ||
continue; |
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.
Any reason why a continue
also needs to be added here? It seems unrelated to the original bug since this is to deal with data URLs?
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.
I added it at Line 124 because I want to make the style consistent. The continue
at Line 118 is for excluding any further processing to the malformed URLs. I think this also applies to the data URLs so I add a continue here.
The extra continue
at Line 124 doesn't affect the existing logic because all the following processing is in the else {...}
block. In fact, we can even remove the else
statement here because the following statements in the for
loop is skipped.
If you feel it's inappropriate to add continue
at Line 124, I can also remove it.
Resolves #11575
The "URI malformed" alert is triggered here.
joplin/packages/lib/services/interop/InteropService_Importer_Md.ts
Line 113 in 2b43a9a
The "malformed" link is less likely to be a Resource URI, so we can leave it as it is. I add the
catch
statement to prevent the alert dialogand log it as a warning.