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

[enhancement] allow filtering of templating specific data attributes from output #15

Merged
merged 5 commits into from
Nov 16, 2022

Conversation

line-o
Copy link
Member

@line-o line-o commented Nov 11, 2022

Setting $templates:CONFIG_FILTER_ATTRIBUTES to true in the
configuration map will filter templating specific data attributes from
the output.
The setting is off by default to keep backwards compatibility.

Add working XQSuite tests to ensure this works.

Example:

Default output:

<html>
    <body data-template="tt:tf" class="body" data-extra="7">2
        <ul>
            <li data-template="templates:each" data-template-from="data" data-template-to="item" data-extra="23" class="item">
                <span data-template="tt:n" data-extra="42" class="value">1</span>
            </li>
            <li data-template="templates:each" data-template-from="data" data-template-to="item" data-extra="23" class="item">
                <span data-template="tt:n" data-extra="42" class="value">3</span>
            </li>
        </ul>
    </body>
</html>

With filtered attributes:

<html>
    <body class="body" data-extra="7">2
        <ul>
            <li data-extra="23" class="item">
                <span data-extra="42" class="value">1</span>
            </li>
            <li data-extra="23" class="item">
                <span data-extra="42" class="value">3</span>
            </li>
        </ul>
    </body>
</html>

Setting `$templates:CONFIG_FILTER_ATTRIBUTES` to true in the
configuration map will filter templating specific data attributes from
the output.
The setting is off by default to keep backwards compatibility.
Add working XQSuite tests to ensure this works.
- copy test-runner and test-suite to build
- fix test-runner and xqSuite
- add xqSuite.js run to test script
- split up tests into set up and several more granular assertions
Copy link
Contributor

@duncdrum duncdrum left a comment

Choose a reason for hiding this comment

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

nicely done, and does what it promises

@duncdrum duncdrum merged commit 35f3136 into eXist-db:master Nov 16, 2022
@line-o line-o deleted the feat/filter-attr branch November 20, 2022 17:07
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