Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not sure if this would be welcome as its kind of an extension... #867

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DigitalSorceress
Copy link

I love parsedown but I really need to be able to have my links use target=_blank on links to external sites

I didn't want to do anything high impact so I added two config options to

$parser->setAllinksInNewWindow(true);
  • simply adds target=_blank to ALL links
    and
$parser->setExtLinksInNewWindow(true);
  • adds target=_blank to links that start with http or https (so absolute links) but leaves target=_self on links that don't start with that

Thus if you make a link [text](foo) or [text](/foo) etc with setExtLinksInNewWindow true, it would not apply target=_blank but [link](https://evensamesite/foo) would

I totally understand if this is not a feature you want to add due to not being standard part of markdown - I'll keep it in my fork for those interested

…down spec so this is a bit of an extension, but I find it highly useful)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant