PrismJS/prism

Keep Markup and zero-length tags

Open

#1,640 建立於 2018年11月30日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)JavaScript (1,296 fork)batch import
bughelp wantedplugins

倉庫指標

Star
 (11,488 star)
PR 合併指標
 (平均合併 86天 15小時) (30 天內合併 12 個 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>

貢獻者指南