Is Opening Links in new Tabs is not supported in the write.as Markdown?
Usually, If you still want to open links in new Tabs, you can then use the following code for your links:
[link](url){:target="_blank"}
Is Opening Links in new Tabs is not supported in the write.as Markdown?
Usually, If you still want to open links in new Tabs, you can then use the following code for your links:
[link](url){:target="_blank"}
Hi @zorbazelda! At the moment it is not supported in the current Write.as Markdown. Iād recommend using HTML instead:
<a href="http://example.com/" target="_blank">Hello, world!</a>
If you wanted to get more technical, you could add Custom JS to your site (if you have a Write.as Pro subscription) that would make each link on your blog open in a new tab. That way you could use Markdown normally and not have to use the above HTML. That JS would look something like this:
var links = document.links;
for (var i = 0, linksLength = links.length; i < linksLength; i++) {
if (links[i].hostname != window.location.hostname) {
links[i].target = '_blank';
}
}
But the you mention would be a perfect suggestion to put in this topic where we are exploring different Markdown standards/options to implement in Write.as. Thanks for bringing this up and hope this answers your question!
Not exactly on the topic, but quite close:
Is it possible to use several javascript strings on the same time? For example, use the above code to open links on new tab, plus some code for the āBack to topā link or footer icons or anything else that would require javascript?
Yes @koulaxizis, you can add multiple functions in the Custom JavaScript section of your blog. That one bit of code above is completely enclosed, so you can then add a function below that which adds the āBack to topā link or footer icons. Itās flexible in that way!
Thanks for this.
@cjeller1592 Thanks for the JS above. Is it possible to make external links open in a new tab but open internal links in the same tab?
By āinternal linksā, I mean when I link to another page on my blog.
Iād appreciate your help if the above is possible.
Should do this via the IF statement above - checks the hostname of the link and if different from the web domain hostname adds the target attribute.
Are there any updates to this?
It would be a huge help to just add an āopen in a new tabā checkbox to this modal.
It would be absolutley great to have this feature (checkbox or markdown update)!
Thanks for the code. This is what I was looking for.
Loren