Giter Site home page Giter Site logo

Comments (6)

danasilver avatar danasilver commented on August 15, 2024 1

The closest python-markdown extension that inserts target="_blank" is markdown-newtab, but it does it for all links. We could fork this and add a check for 'http' in elem.get('href') when it decides whether to add the attribute.

from docs.

danasilver avatar danasilver commented on August 15, 2024 1

I forked markdown-newtab and added an external_only option as described above.

from docs.

mfurtak avatar mfurtak commented on August 15, 2024 1

@i2amsam Dropped this in chat the other day. I don't know that it's relevant to a static site like this, but it seems worth mentioning: https://mathiasbynens.github.io/rel-noopener/ (talks about target=_blank vulnerabilities)

from docs.

KrauseFx avatar KrauseFx commented on August 15, 2024 1

@mfurtak

Also we have to make sure to properly set the tag to not give control over the tab to the external page

Yeah, that's what I meant, but couldn't remember it was called rel-noopener, definitely important 👍

from docs.

danasilver avatar danasilver commented on August 15, 2024

That's a really interesting vulnerability I didn't know about. I think it's still valid for static sites. That makes more sense @KrauseFx; I figured you meant opening in the background like Command + Click does.

Could modify the markdown-newtab to add rel="noopener" as well if that's a good enough mitigation.

from docs.

janpio avatar janpio commented on August 15, 2024

Is this still relevant? It's pretty common nowadays for links to just be opened in the same page/tab, and people using middle click or right-click -> new tab for this.

from docs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.