I'm not sure what you mean by "the bit with the link is not quite right". Do you have an example you could share so we might replicate what you're seeing? Could you let me know what you might expect? (I'll admit I was doing this incredibly late at night and haven't battle tested it against the hundreds of links I typically would, particularly in hopes that someone would do something like this:
).
I've already seen a few websites that include a `|` character in their titles, and those require a manual tweak to make sure the links work appropriately once you've saved your Tiddler.
Most of the code was straightforward enough for me to figure out based on a handful of examples I was able to find. (I know no JavaScript.) Most of the confusing portions for the formatting are really just knowing the proper escape characters and html entities so that when you cut and paste them you get the correct results. You can find a list of html entities at many sites including
https://www.freeformatter.com/html-entities.html and having that as a cheat sheet should allow you to get things to work exactly the way you'd like to have them if you want to tinker around.
I have a suspicion that someone with more JavaScript skills than I might be able to:
* allow for cutting and pasting of a full HTML version of text from a website (to get the links and other top level html tags as well)
* potentially include a "key" to a particular TW5 instance's location (URL) so that instead of needing to cut and pasting, the entirety of the cut/pasted content and details are automatically be sent to one's TW and entered into a new Tiddler.
* These would potentially allow the bookmarklet to be built into TW core so that new users could drag and drop a link from a Tiddler (perhaps from a tab in the Control Panel) into their browser bar that would "just work"™.
I also did things from a relatively basic boiler plate and then gradually tweaked them step-by-step to get the output I wanted. If you want my scratch pad and some hints or alternate versions, here's a useful Tiddler:
http://tw.boffosocko.com/#Bookmarklet%20experiments