Skip to content

Commit

Permalink
Remove SPAN dos elementos compatíveis com HTML inline, pois, no XSD d…
Browse files Browse the repository at this point in the history
…o LexML, ele requer atributos de link
  • Loading branch information
juliomelo committed Jun 25, 2024
1 parent c6db356 commit 6367158
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lexml/exportarParaLexML.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import padrao from '../opcoesPadrao';
import ArticulacaoInvalidaException from './ArticulacaoInvalidaException';
import { TipoElementoLexML } from './TipoElementoLexML';

const htmlInline = new Set(['SPAN', 'B', 'I', 'A', 'SUB', 'SUP', 'INS', 'DEL', 'DFN']);
const htmlInline = new Set(['B', 'I', 'A', 'SUB', 'SUP', 'INS', 'DEL', 'DFN']);

/**
* Exporta para o XML definido no LexML (http://projeto.lexml.gov.br/documentacao/Parte-3-XML-Schema.pdf),
Expand Down Expand Up @@ -377,7 +377,7 @@ function criarElementoP(paragrafo: Element) {
return elemento;
}

function criarConteudoInline(origem: Element, destino: Element) {
function criarConteudoInline(origem: Element, destino: Element): Element {

interface IContextoExportacao {
/**
Expand Down Expand Up @@ -433,7 +433,7 @@ function criarConteudoInline(origem: Element, destino: Element) {
retrocederEm: item.parentNode as Element,
destino: elemento
};
} else if (item.tagName === 'BR') {
} else if (item.tagName === 'BR' || item.tagName === 'SPAN') {
// Ignora
} else {
throw new ArticulacaoInvalidaException(origem, 'Elemento não permitido: ' + item.tagName);
Expand Down

0 comments on commit 6367158

Please sign in to comment.