Skip to main content

Adds a taget="_blank" attribute to HTML links in Markdown

Project description


Adds a taget="_blank" attribute to HTML links in Markdown

This extension adds a taget="_blank" attribute to the HTML output when links are parsed from markdown.
It is not added if the href starts with a # so


will not be touched. Whereas:

[link_text](url) will become <p><a href="url" target="_blank">link_text</a><

Install through pip:

$ pip install MarkdownLinkTarget

To enable the MarkdownLinkTarget package and use it in your markdown generation just add it like so:

import markdown
from MarkdownLinkTarget.linktarget import TargetLinkExtension

result = markdown.markdown(textToRender, extensions=[TargetLinkExtension,]))

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for MarkdownLinkTarget, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size MarkdownLinkTarget-0.1.0.tar.gz (1.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page