PrismJS/prism

Keep Markup and zero-length tags

Open

#1.640 geöffnet am 30. Nov. 2018

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (1.296 Forks)batch import
bughelp wantedplugins

Repository-Metriken

Stars
 (11.488 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 86T 15h) (12 gemergte PRs in 30 T)

Beschreibung

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>

Contributor Guide