showdownjs/showdown

Expose blockTags in subParser 'hashHTMLBlock'

開放

#871 建立於 2021年11月8日

 (2 則留言) (1 個反應) (1 位負責人)JavaScript (1,640 個分叉)batch import
enhancementhelp wanted

倉庫指標

星標
 (13,700 顆星)
PR 合併指標
 (平均合併 15小時 21分鐘) (30 天內合併 3 個 PR)

描述

I am trying to force showdown to ignore my custom HTML tags for my text editor. The block tags is a list of tags that will be ignored during parsing, and adding my custom tag names to this list achieves the desired result: i.e. the text inside the tags are not parsed.

For now I achieved my desired result by adding a div tag around my custom tags like so:

type: 'lang',
regex: /<TagName(.*?)<\/TagName>/gs,
replace: '<div><TagName$1<\/TagName></div>'

貢獻者指南