uzh/marugoto

Small HTML-related issues

Closed this issue · 3 comments

The player is asked to copy and paste a URL into the Notebook (e.g. 1.1.3); he/she then continues to 1.1.4 and the notebook entry they have made is saved with a timestamp. If, on 1.1.4 or subsequent pages, the player goes back to the page in the notebook called "Putnam" and clicks on the URL in the notebook, the link opens in the same tab as marugoto.
--> can any hyperlink in the notebook added by a player automatically open as a new tab in the web browser?

It must be possible. I will look into how this currently works and make a fix.

OK, it turned out this was quite hard to fix.

Long story short, the user is entering markdown here. By default, things that look like links are made into hrefs automatically. But by default, the href opens in same tab. @witlox you noticed that notebook content would be turned into HTML --- it seemed like a weird feature, but if disabled, then the user can't add such clickable links. So that's why it's coded like that.

So, hopefully the fix is to do this: uzh/marugoto-frontend@886043f

But by doing this, I could have changed some other behaviour in the game that I'm not aware of (i.e. other links might now open in new tab?).

It may also be possible with something in add-personal-notes-box of src/components/03_organisms/notebookContainer/notebookPages/template.html:

<vue-markdown :anchorAttributes="{ target: '_blank' }" :source="component.personalNote.markdownContent" />

If the current approach has broken something, perhaps we'll try messing around with that, because it's more confined to just that one markdown block. However, it may be anchor-attributes, may need props, it will take more experimenting.

But as the present solution seems to be working, I'll close.

Thanks, Danny--nice work. I'll keep an eye on whether other things are broken as a consequence of this. Cheers, Martin