PrismJS/prism

Keep Markup and zero-length tags

开放

#1,640 创建于 2018年11月30日

 (0 条评论) (0 个反应) (0 位负责人)JavaScript (1,296 个派生)batch import
bughelp wantedplugins

仓库指标

星标
 (11,488 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

The current implementation of the Keep Markup plugin does not handle zero-length tags (tags with textContent.length == 0) correctly.

It will move any nested zero-length tag at the end of its parent outside and after its parent, effectively flattening the markup structure. Examples:

  • <x><y></y></x> -> <x></x><y></y>
  • <x>a<y></y></x> -> <x>a</x><y></y>
  • <x>a<y></y><z></z></x> -> <x>a</x><y></y><z></z>
  • <x>a<y><z></z></y></x> -> <x>a</x><y></y><z></z>

贡献者指南