showdownjs/showdown

Expose blockTags in subParser 'hashHTMLBlock'

Open

#871 opened on 2021年11月8日

GitHub で見る
 (2 comments) (1 reaction) (1 assignee)JavaScript (1,640 forks)batch import
enhancementhelp wanted

Repository metrics

Stars
 (13,700 stars)
PR merge metrics
 (平均マージ 15h 21m) (30d で 3 merged PRs)

説明

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>'

コントリビューターガイド