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

贡献者指南