Skip to content

Fix bug in LessonChecker.py - #434

Merged
TApplencourt merged 2 commits into
KhronosGroup:mainfrom
MikeL270:fix_htmlparser
Aug 3, 2026
Merged

Fix bug in LessonChecker.py#434
TApplencourt merged 2 commits into
KhronosGroup:mainfrom
MikeL270:fix_htmlparser

Conversation

@MikeL270

@MikeL270 MikeL270 commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

This PR seeks to fix a bug in the LessonChecker.py script where when a <pre> and <code> tag are swapped and there is any kind of white space character other than \n between them like \t the parser fails to swap the tags due to how it always checked the last member of self.output, for a <code> tag, when in this case its actually one or more \t characters.

I fixed the bug by having the parser use the last_code_idx property. I introduced an appropriate test to prevent regression.

This issue was discovered when image_convolution failed evaluation with LessonChecker.py. It correctly identified the issue, but auto fix failed to fix the issue since the last element of self.output was \n\t\t\t\t... instead of the expected <code>. This PR also includes the autofixed image_convolution lesson.

Comment thread Scripts/LessonChecker.py Outdated
Comment thread Scripts/LessonChecker.py Outdated
@TApplencourt
TApplencourt merged commit 6ec5015 into KhronosGroup:main Aug 3, 2026
4 checks passed
MikeL270 added a commit to MikeL270/syclacademy that referenced this pull request Aug 3, 2026
* fix lesson checker bug then used it to fix image_convolution
* remove stray tab, replace ignores with assertions
@MikeL270
MikeL270 deleted the fix_htmlparser branch August 3, 2026 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants