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

Target Blank #158

Open
KvL159 opened this issue Jan 21, 2021 · 7 comments
Open

Target Blank #158

KvL159 opened this issue Jan 21, 2021 · 7 comments

Comments

@KvL159
Copy link

KvL159 commented Jan 21, 2021

First of all, thank you for this great add-on to Nextcloud !

I'm trying to set some links with target blank to open them in new tabs/new windows.

I found some answer about how to handle it in Markdown, but it doesn't seem to work with CMS Pico in Nextcloud:
https://stackoverflow.com/questions/4425198/can-i-create-links-with-target-blank-in-markdown

I did try [text](url){:target="_blank"} as suggested in the link above, however it ignores what's after the url and shows it as text.

@PhrozenByte
Copy link
Collaborator

Unfortunately that's not possible right now, because Parsedown, the Markdown parser Pico uses, isn't capable of doing so.

@KvL159
Copy link
Author

KvL159 commented Jan 22, 2021

Thank you @PhrozenByte

I found that "parsedown-extra-plugin" may offer such function, do you think it can be added to Pico ?

https://github.com/taufik-nurrohman/parsedown-extra-plugin#automatic-relnofollow-attribute-on-external-links

Upstream discussion:
erusev/parsedown#494

@github-actions
Copy link

github-actions bot commented Mar 9, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in two days if no further activity occurs. Thank you for your contributions! 👍

@sm8ps
Copy link

sm8ps commented Sep 27, 2022

Sorry for reviving an old thread! I have just come across it and was wondering why this cannot be circumvented by specifying the link as HTML in the Markdown like
<a href="https://github.com/nextcloud/cms_pico" target="_blank">cms_pico</a>.

The link is shown but does not behave as hoped. Is this expected behavior? If so, is there any reason not to adapt it?

@PhrozenByte
Copy link
Collaborator

@sm8ps HTMLPurifier doesn't allow this by default. However, target="_blank" yields no threats in our scenario, so we should add it to the allow list. Thus I'm transforming this issue to an suggestion.

@sm8ps
Copy link

sm8ps commented Sep 27, 2022

Great, thanks! I think this will be much appreciated by many users.

@new-on-github
Copy link

Any news on this? Where can this be added to the whitelist?

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants