2017-04-11 72 views
0

降價自動開啓有效的HTML鏈接到鏈接,例如。 http://example.com變爲http://example.com如何防止在Markdown表中自動鏈接?

(你可以試試這個,例如,在github上回購引發一個問題,在http://example.com打字,然後在看「預覽」選項卡 - 因爲github上使用降價。)

當降價遭遇一個HTML標籤,它會阻止這種行爲,例如。 <div>http://example.com</div>停留只是http://example.com

然而,似乎如果您在降價表中使用<div> S,然後開始再次自動linkifying,例如。如果鍵入:

|Parameter|Value| |-------|-------| |Date |Tue Jan 01 1980| |Parameter|<div>http://example.com</div>|

你會看到http://example.com是一個鏈接。

我使用markdown-it,但正如我所說,它也與GitHub的降價情況。

我怎樣才能防止降價表這種自動linkification?

回答

0

防止降價從解析內容的最可靠的方法是把它包在一個碼跨度。有些人甚至會說,一個純文本網址應始終包裹在一個碼跨度:

Some text with a URL: `http://example.com`. 

|Parameter|Value| 
|-------|-------| 
|Date |Tue Jan 01 1980| 
|Parameter|`http://example.com`| 
相關問題