PrismJS/prism

Keep Markup and zero-length tags

オープン

#1,640 opened on 2018/11/30

 (0 件のコメント) (0 件のリアクション) (0 人の担当者)JavaScript (1,296 件のフォーク)batch import
bughelp wantedplugins

Repository metrics

Stars
 (11,488 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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>

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