PrismJS/prism

Keep Markup and zero-length tags

Open

#1 640 ouverte le 30 nov. 2018

Voir sur GitHub
 (0 commentaires) (0 réactions) (0 assignés)JavaScript (1 296 forks)batch import
bughelp wantedplugins

Métriques du dépôt

Stars
 (11 488 stars)
Métriques de merge PR
 (Merge moyen 86j 15h) (12 PRs mergées en 30 j)

Description

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>

Guide contributeur