Markdown.Sanitizer removes <a href= and <img src= tags referencing relative paths
- 主要語言
- JavaScript
- 星號
- 0
- 分支
- 0
- PR 合併指標
- 30 天內沒有已合併 PR
描述
```
The part
(https?:\/\/|\/)
in Markdown.Sanitizer var img_white only allows full URLs:
http://... or https://...
or in-site URLs relative to the root
/...
As a consequence, the markdown code
"
producing the html code

is removed by Markdown.Sanitizer, because the in-site URL is relative to the
current path.
The same applies to var a_white
Solution:
Add an extra ? as follows:
(https?:\/\/|\/?)
```
Original issue reported on code.google.com by `geet...@yahoo.co.uk` on 9 Oct 2014 at 12:44
貢獻指南
這個儲存庫沒有索引到貢獻指南
研究方向
查看 Markdown.Sanitizer 的程式碼,可能位於名為 sanitizer.js 或類似名稱的檔案中。找出目前會封鎖相對路徑的 img_white 和 a_white 正規表示式模式。更新正規表示式以允許可選的前置斜線,然後建立一個包含相對圖片路徑的 Markdown 片段進行測試,並確認它沒有被移除。
由索引模型根據 Issue 內容生成。
評估
- 領域
- web-dev
- Issue 類型
- 缺陷
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 活躍度
- 停滯
- 描述清晰度
- 描述清楚
- 新手友好度
- 70/100