-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Import note from url with markdown #1981
Conversation
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.
please confirm my review!
and please fix from eslint.
please user yarn instead of npm.
} | ||
} | ||
|
||
confirm () { |
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.
please add a test!
Moved the function to the dataApi folder, so that a test can be created easier. But I'm struggling to write the test at the moment, so I'll take a look a little later. If someone want's to take a look, feel free too. |
import { hashHistory } from 'react-router' | ||
import ee from 'browser/main/lib/eventEmitter' | ||
|
||
function validateUrl(str) { |
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.
This method could be simplyfied to
return str.matches(new RegExp('^(?:.......'));
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 just used the jQuery implementation for validating 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.
Oh, my idea would have introduced the opportunity for null pointers.. So it's good that you ignored my concern :D
@StormBurpee (I'll review the test written by you, later.) |
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.
Please remove package-lock.json
and use yarn
instead of npm
when developing.
Anyway, it looks great first step of the feature. Nice work! |
@StormBurpee please confirm our reviews! |
I'm going to close this issue because of the inactivity. |
Hi guys,
Thought I'd try and create the feature asked for at #923
The solution I came up with is quite friendly, and provides an easy way to put in a URL and convert it to Markdown. Let me know what you guys think!
The new note screen, note the import from url at the bottom
The new modal, for adding a url and importing
The result in split markdown view
The final result of the imported note