PrismJS/prism

Keep Markup and zero-length tags

Open

#1,640 opened on 2018年11月30日

GitHub で見る
 (0 comments) (0 reactions) (0 assignees)JavaScript (1,296 forks)batch import
bughelp wantedplugins

Repository metrics

Stars
 (11,488 stars)
PR merge metrics
 (平均マージ 86d 15h) (30d で 12 merged PRs)

説明

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>

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