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

Get Selection HTML? Or in Markdown? #76

Closed
ghost opened this Issue Mar 5, 2012 · 4 comments

Comments

Projects
None yet
1 participant
@ghost

ghost commented Mar 5, 2012

Is there a way to get the HTML of the selection? Or, alternatively, get it in Markdown including links and bold?

Any of these will be very useful for capturing article snippets for republication.

@ghost ghost assigned neocotic Mar 6, 2012

@neocotic

This comment has been minimized.

Member

neocotic commented Mar 6, 2012

This is a great idea! Fortunately, I think my code already does most of the work and should just be a matter of exposing that value to be used in templates (e.g. selectionHTML).

As for Markdown; I believe there is a html2text python script that could convert the above HTML in to valid Markdown. I'd need to find an existing port of this for JavaScript or create my own one (which would take time). It really depends if just capturing the HTML would be sufficient. Keep in mind that this would capture all the HTML behind the selection, including script tags etc. which would probably not be desired in most cases.

@neocotic

This comment has been minimized.

Member

neocotic commented Mar 6, 2012

Thanks to this I just realized a major bug in the compiled code which caused most of the template variables which are derived from the page code to be ignored.

I've raised #77 to deal with this.

I'm also considering adding 2 more variables along with selectionHTML which publishers may find useful;

  • images - The URLs of all images on a page
  • selectedImages - The URLS of all images in a selection
@neocotic

This comment has been minimized.

Member

neocotic commented Mar 6, 2012

I really want to the fix for #77 live so I'm going to deliver these changes together for 1.0.3. This will include all of the new template variables mentioned so far in this issue.

However, if you want me to continue looking in to the Markdown option can you please create a new issue and reference this one (i.e. #76).

@neocotic neocotic closed this Mar 6, 2012

@ghost

This comment has been minimized.

ghost commented Mar 6, 2012

This will include all of the new template variables mentioned so far in this issue.

That's great, neocotic! selectedImages can be very useful too. Good idea.

However, if you want me to continue looking in to the Markdown option can you please create a new issue and reference this one (i.e. #76).

I will. But first I've found a bug on the Mac related to the key bindings. -- I'll post about it now...

@ghost ghost referenced this issue Mar 6, 2012

Closed

Get Selection in Markdown #82

@neocotic neocotic added the accepted label Nov 15, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment