Open sashton opened 8 years ago
On investigation, it looks like my suspicion is confirmed: https://github.com/JonyEpsilon/gorilla-repl/blob/develop/resources/gorilla-repl-client/js/renderer.js#L20
The event listener there is returning false. Maybe a solution would be to return false if alt
is pressed, but true if otherwise, to allow normal href behavior to occur.
As a workaround, I added an ugly javascript onclick
handler to get the navigation to happen:
#gorilla_repl.html.HtmlView{:content ("<a href=\"http://www.google.com\" onclick=\"window.open('http://www.google.com');\">google</a>")}
This was done to stop the case where you click on a link and then lose your unsaved work in Gorilla, which is very annoying!
Having a modifier that allows you to follow the link (a bit like in MS Word) is a nice idea.
Keeping unsaved work is definitely a good idea. In my snippet above I solved that by opening the link in a new browser window.
I've tried adding an href to HtmlView output. The link renders, but on clicking it, the browser doesn't navigate. Is there some global click handler which is preventing it?
Example: