Markdown hyperlink with target = & #39; _ blank & #39;, markdowntarget

Source: Internet
Author: User

Add the target = '_ blank' and markdowntarget to the markdown hyperlink.

Markdown supports two forms of link Syntax:InlineAndReference.

Any type of link text is used [Square brackets].

To create a line link, you only need to insert a URL link after square brackets followed by parentheses,

If you want to add the title Text of the link, you only need to wrap the title text behind the URL with double quotation marks. For example:

This is [an example](http://example.com/ "Title") inline link.
Will generate

<p>This is <a href="http://example.com/" title="Title">an example</a> inline link.</p>

The reference link is followed by another square brackets of the link text, and the second square brackets should be filled with the mark used to identify the link:

This is [an example][id] reference-style link.
Next, you can define the link content of the tag wherever the file is:

[id]: http://example.com/  "Optional Title Here"

The generated hyperlink is opened in this window by default. To have a better reading experience, we often want

Open the hyperlink and do not want to affect reading this article. Markdown does not currently support this syntax,

However, you can use other methods to solve this problem. For example, add the following code to jQuery:

<Script type = "text/javascript"> $ (document ). ready (function () {// Add the target = '_ blank' attribute to the hyperlink $ ('a [href ^ = "http"] '). each (function () {$ (this ). attr ('target', '_ blank') ;}); </script>


Author: itmyhome



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.