4 ms·
shameless plug: client-side (or node) html > markdown, like actual conversion demo: http://leeoniya.github.com/reMarked.js/ http://leeoniya.github.com/reMarked
by leeoniya 14y ago
shameless plug: client-side (or node) html > markdown, like actual conversion
demo: http://leeoniya.github.com/reMarked.js/ http://leeoniya.github.com/reMarked.js/
repo: https://github.com/leeoniya/reMarked.js https://github.com/leeoniya/reMarked.js
- dazmax 14y agoIs that available as a bookmarklet, where you can select content on an existing page and extract markdown to the clipboard?
- leeoniya 14y agoit'd be fairly easy to make one, but i imagine it would have limited utility since the entire content of the page is rarely what you want. how would you go about selecting which portion you're interested in? also, i'm not certain a bookmarklet would have direct clipboard access due to security, i could be wrong tho. feel free to open up an issue on github to discuss the idea and implementation details further.
- nieve 14y agoThis may have changed in the last few years, but I believe you can simply do "window.getSelection()" in your bookmarklet to access the currently selection for Firefox/WebKit browsers.
- leeoniya 14y agomight be worth trying. however, i'm still not convinced the presented use-case would be useful rather than just cool.
- nieve 14y agoSadly you're almost certainly right. Most of the places I could see wanting to reverse-engineer the displayed HTML into Markdown are actually sites using their own hackish, inconsistently rendered output. You'd end up needing per-site tweaks and that'd kind of render the whole thing unworkable and pointless.
- mrcoles 14y agocool!
- jeswin 14y agoNice! I am working on an editor (based on content-editable) which translates to markdown. If your script handles invalid html I might as well use yours.
- leeoniya 14y agoit relies on the client's html > DOM conversion, so in a sense it does. but it does not have a self-contained html parser.