PrismJS/prism

Keep Markup and zero-length tags

Aberta

#1.640 aberto em 30 de nov. de 2018

 (0 comentário) (0 reação) (0 responsável)JavaScript (1.296 forks)batch import
bughelp wantedplugins

Métricas do repositório

Stars
 (11.488 estrelas)
Métricas de merge de PR
 (Métricas PR pendentes)

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>

Guia do colaborador