-
-
Save parzibyte/e9cb0a3b9a85ddab79533aeea022f5d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int i = 0; | |
const char simboloInicio = '<'; | |
const char simboloFin = '>'; | |
int ignorando = 0; | |
// Recorrer el cuerpo e ignorar etiquetas | |
for (i = 0; i < strlen(cuerpoHtml); i++) | |
{ | |
char caracterActual = cuerpoHtml[i]; | |
// Si encontramos una etiqueta abriendo, establecemos la bandera en true | |
if (caracterActual == simboloInicio) | |
{ | |
ignorando = 1; | |
} | |
// Si encontramos el del final, establecemos la bandera en false | |
if (caracterActual == simboloFin) | |
{ | |
ignorando = 0; | |
} | |
// Si no debo ignorar este carácter, y éste carácter no es >, entonces es un carácter válido | |
if (!ignorando && caracterActual != simboloFin) | |
{ | |
// Aquí se puede hacer cualquier cosa con el char. Yo solo lo estoy concatenando | |
concatenarCharACadena(caracterActual, contenidoLimpio); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment