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

HTML Attributes Ignored on Images #90

Closed
tajmone opened this issue Oct 21, 2022 · 4 comments
Closed

HTML Attributes Ignored on Images #90

tajmone opened this issue Oct 21, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@tajmone
Copy link
Contributor

tajmone commented Oct 21, 2022

I noticed that with PMLC 3.1.0 I'm failing to render HTML Attributes for images alt or title text:

[image source="./apple.png" html_alt="Some text"]
[image source="./apple.png" html_title="Some text"]

both statements will just produce the following HTML snippet:

<figure style="text-align: left">
    <img class="pml-image" src="./apple.png">
</figure>

As far as I can remember, both used to work fine in my previous tests with PML 2.x, and the html_alt is even mentioned in the PML User Manual examples.

I haven't had a chance to test whether this is affecting just images or other elements too, but it definitely looks like a bug that crept in with the latest updates (either 3.0 or 3.1.0).

@tajmone tajmone added the bug Something isn't working label Oct 21, 2022
@pml-lang
Copy link
Owner

The underlying bug is that HTML attributes (html_xxx) for media nodes (image, audio, video) are ignored in the HTML renderer.

The bug is now fixed in the develop branch, and the fix will be included in the next public version.

Thanks for reporting this bug.

@tajmone
Copy link
Contributor Author

tajmone commented Oct 25, 2022

Fuzz Testing?

Since the PML syntax is quite complex in terms of all the possible combinations of nodes and attributes, types of attributes values, as well node contexts, it's going to be very hard to be able to manually cover all possible test conditions (both valid and invalid, to test successes and proper error handling).

Probably the best solution would be to rely on fuzz testing instead.

I believe there are various Java libraries for fuzz testing, either native or ported (e.g. JQF). Although it would require investing energy on its initial setup, I believe it's worth the costs since it will therefrom grant solid test coverage for all the various combinations between nodes, and between nodes and their attributes.

If I've understood correctly, most fuzzing libraries require you define a rule-based driver, via some sort of grammar describing a template for the possible combinations in the generated input sources fed to to test unit.

With syntaxes like PML, it's just too hard to manually cover all edge cases testing, and bugs tend to get by unnoticed for a long time.

@pml-lang
Copy link
Owner

Interesting idea!
Thanks for the links.
I'll have a look at them.

@pml-lang
Copy link
Owner

Fixed in version 4.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants