We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Is there a way to add target="_blank" to hyperlinks?
target="_blank"
Thanks, Alvaro
The text was updated successfully, but these errors were encountered:
No, but I will accept a PR that adds an optional method to the configuration for determining if a link should be opened in a new tab or not:
import JSONFormatter from 'json-formatter-js' const myJSON = {external_link: 'http://example.com', internal_link: 'https://my-domain.com' }; const formatter = new JSONFormatter(myJSON, 1, { getTargetForHyperlink(link: string) { const url = new URL(link); return url.hostname === 'my-domain.com' ? '_self' : '_blank'; } }); document.body.appendChild(formatter.render());
Sorry, something went wrong.
This can be addressed with #17 which is a TODO in this repo
No branches or pull requests
Is there a way to add
target="_blank"
to hyperlinks?Thanks,
Alvaro
The text was updated successfully, but these errors were encountered: