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

Protect authors from invalid definitions. #231

Closed
wants to merge 3 commits into from

Conversation

bstopp
Copy link

@bstopp bstopp commented Jun 28, 2023

Please always provide the GitHub issue(s) your PR is for, as well as test URLs where your change can be observed (before and after):

Fix #230

Test URLs:

@aem-code-sync
Copy link

aem-code-sync bot commented Jun 28, 2023

Hello, I'm Franklin Bot and I will run some test suites that validate the page speed.
In case there are problems, just click the checkbox below to rerun the respective action.

  • Re-run PSI Checks

@davidnuescheler
Copy link
Contributor

i think while we are at it we could also use something .classList.add(...styles.filter(style => style)) which would improve on the .forEach(), and would keep the text transformation line (which is already a bit unreadable).

@bstopp
Copy link
Author

bstopp commented Jul 25, 2023

What about?

          const styles = meta.style.split(',')
            .filter((style) => style.trim())
            .map((style) => toClassName(style.trim()));
          section.classList.add(...styles);

@davidnuescheler davidnuescheler self-requested a review July 25, 2023 17:51
@kptdobe
Copy link
Contributor

kptdobe commented Dec 18, 2023

@bstopp Closing this PR. This seems to be an important fix, could you bring it to https://github.com/adobe/aem-lib (+tests). Thanks a lot.

@kptdobe kptdobe closed this Dec 18, 2023
@bstopp
Copy link
Author

bstopp commented Dec 18, 2023

Moved to AEM Lib

@bstopp bstopp deleted the bug/section-style-metadata branch December 18, 2023 17:50
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.

"Invalid" Style section metadata prevents pages from rendering
3 participants