Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix html in descriptions or datasets #1001

Merged

Conversation

faissaloux
Copy link
Contributor

What:

  • [ x ] Bug Fix
  • [ - ] New Feature

Description:

Termwind raises a StyleNotFound exception when a test dataset or description includes html tags with class attribute, as Termwind tries to style it as html element but the class is not supported.

Example:
Screenshot from 2023-11-07 17-36-58
photo_2023-11-07_17-52-38

If the test desciption doesn't include html tags with class attribute, Termwind will raise the same exception for dataset.

I have converted html tags into HTML entities so that Termwind will treat it as normal text. And the result will shows as written in the test description or Dataset:

Screenshot from 2023-11-07 17-50-31

PS: Same thing applies on describe().

@@ -20,7 +20,7 @@
'卜竹弓一十山' => '__pest_evaluable_卜竹弓一十山',
'アゴデヸ' => '__pest_evaluable_アゴデヸ',
'!p8VrB' => '__pest_evaluable__p8VrB',
'&xe6VeKWF#n4' => '__pest_evaluable__xe6VeKWF_n4',
'&xe6VeKWF#n4' => '__pest_evaluable__amp_xe6VeKWF_n4',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why you had to change this?

Copy link
Contributor Author

@faissaloux faissaloux Nov 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's because $__latestDescription changes here after changing the description HTML tags to HTML entities.

$this->__description = self::$__latestDescription = $description;

@@ -33,7 +33,7 @@
'Каролин' => '__pest_evaluable_Каролин',
'অ্যান্টার্কটিকা' => '__pest_evaluable_অ্যান্টার্কটিকা',
'Frýdek-Místek"' => '__pest_evaluable_Frýdek_Místek_',
'Allingåbro&' => '__pest_evaluable_Allingåbro_',
'Allingåbro&' => '__pest_evaluable_Allingåbro_amp_',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why you had to change this?

@nunomaduro nunomaduro merged commit 3c0d780 into pestphp:2.x Nov 8, 2023
20 checks passed
@faissaloux faissaloux deleted the fix-html-in-descriptions-or-datasets branch November 8, 2023 09:42
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.

None yet

2 participants