PrismJS/prism

Keep Markup and zero-length tags

Open

#1640 aperta il 30 nov 2018

Vedi su GitHub
 (0 commenti) (0 reazioni) (0 assegnatari)JavaScript (1296 fork)batch import
bughelp wantedplugins

Metriche repository

Star
 (11.488 star)
Metriche merge PR
 (Merge medio 86g 15h) (12 PR mergiate in 30 g)

Descrizione

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>

Guida contributor