Skip to main content

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

Project description

markdown.linktarget
==================

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

[link](#something)

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


Release history Release notifications

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
MarkdownLinkTarget-0.1.0.tar.gz (1.4 kB) Copy SHA256 hash SHA256 Source None Feb 11, 2015

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page