Skip to content

feat(lxp): Add parser option to disable attribute positions#41

Open
Omikhleia wants to merge 2 commits intolunarmodules:masterfrom
Omikhleia:feat-option-disable-attribute-positions
Open

feat(lxp): Add parser option to disable attribute positions#41
Omikhleia wants to merge 2 commits intolunarmodules:masterfrom
Omikhleia:feat-option-disable-attribute-positions

Conversation

@Omikhleia
Copy link
Copy Markdown

@Omikhleia Omikhleia commented Dec 6, 2024

This PR is a proposal to add an additional flag to disable the attribute positions in the attribute list passed on StartElement.

Rationale:
I understand attribute positions may be interesting in some use cases (e.g. to re-generate some other output respecting the same order), but for use cases where they are not needed, they take useless memory, and useless code if one wants to remove them.

Note:
I also fixed a small mistake in the example that was given in the "manual" (the position list consists in attribute names, not attribute value).

For reference:

@Omikhleia Omikhleia force-pushed the feat-option-disable-attribute-positions branch from 8c2b92f to 5dbfb96 Compare December 6, 2024 13:36
Copy link
Copy Markdown
Member

@Tieske Tieske left a comment

Choose a reason for hiding this comment

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

Can you please add some tests?

Comment thread docs/manual.html
{[1] = "Ierusalimschy, Roberto",
[2] = "Programming in Lua",
{[1] = "author",
[2] = "title",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

good catch!

Comment thread docs/manual.html Outdated
Co-authored-by: Caleb Maclennan <caleb@alerque.com>
@Omikhleia
Copy link
Copy Markdown
Author

Omikhleia commented Jan 7, 2025

Can you please add some tests?

It's not clear to me how to write and run tests for this module (looking at the spec files, it apparently requires busted and penlight. Beyond that, I'm a bit lost, and dunno how to run them locally - Or more precisely, what to put in a docker file to run them (I don't install anything on my hosts). Of course, I could just try at random, and hope the github actions to do it automatically, but that trial and error process would not the most convenient way... Any pointer or contribution guideline would be welcome.

@alerque
Copy link
Copy Markdown
Member

alerque commented Jan 10, 2025

I can probably help with getting a test added.

@alerque alerque self-assigned this Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants