WikiEducationFoundation / WikiEduDashboard

Wiki Education Foundation's Wikipedia course dashboard system
https://dashboard.wikiedu.org
MIT License
386 stars 600 forks source link

Links from course description and timeline should open in new tabs #1393

Open ragesoss opened 7 years ago

ragesoss commented 7 years ago

Most of these are links to external resources, so it will be better if they open a new tab instead of navigating away.

I'm not sure whether this can be done with CSS, or whether it will require tweaks to the markdown parser config, or what.

majakomel commented 7 years ago

I would like to work on this one

testa19 commented 7 years ago

@majakomel is this https://css-tricks.com/snippets/jquery/open-external-links-in-new-window/ - ok trick?

majakomel commented 7 years ago

I have opened PR #1397 but it solves the issue only for links in course description (needed only markdown parser config). Timeline content is unlike course description stored as HTML and Trix editor doesn't have this option. I could either parse the content and add target="_blank" attribute to <a> before saving to the db or probably better solution, use suggestion @testa19 offered. I'm just not sure in which js file this kind of snippet belongs.

ragesoss commented 7 years ago

@testa19 one other option that might fix it 90% of the way would be to add target="_blank" to all the pregenerated timeline html from the wizard content.yml files. I'm not sure whether Trix will strip that out upon saving an edit, though.

The description is the more important part. I definitely don't want to resort to jquery to define that behavior. If we're going to do it for the Trix html, I think we should keep it within the React domain. It looks like there are some possible approaches discussed here:

ragesoss commented 7 years ago

The course description fix is merged.