Comment blocks with open and close angle brackets fail to parse with mis-aligned tabs using Parse(const char*, size_t)

Abierto
#929 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
22/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
cpp
Área
devtools

Línea de trabajo

Start by reproducing the failure: feed the attached blocksdef.txt, with the comment block indented by mixed tabs, into tinyxml2::Parse using the (const char*, size_t) overload, and confirm it returns XML_ERROR_PARSING_TEXT. The issue does not name the parser source file or function, so find where comment blocks are scanned. Done means the original file parses without re-indenting, and the existing tests still pass.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Take a comment block like

			<!--
	<Argument>
	<Name>Amount</Name>
	<Type>Integer</Type>
	<DefaultValue>1</DefaultValue>
	<Minimum>1</Minimum>
	<Maximum>1</Maximum>
	</Argument>
-->

that is in the following file (with all context included)
blocksdef.txt

Passing this into tinyxml2::Parse(const char, size_t) will result in the following error XML_ERROR_PARSING_TEXT and removing the comment block successfully parses the file.

I have deduced the error to be that the angle brackets that may have open and close values <> in the line below the comment block instantiation <!-- must be tab aligned with the comment block to resolve the issue, so you can fix the issue by just tabbing the comment block in like so

			<!--
			<Argument>
			<Name>Amount</Name>
			<Type>Integer</Type>
			<DefaultValue>1</DefaultValue>
			<Minimum>1</Minimum>
			<Maximum>1</Maximum>
			</Argument>
-->

Due to the fact that a user may not be able to edit the source file, a way to ignore the tab difference in comment blocks would be great. Thank you!

Lenguaje dominante
C++
Estrellas
5.8k
Forks
2k
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de leethomason/tinyxml2

Todos los issues de leethomason/tinyxml2

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.