Skip to content

Conversation

@buuhuu
Copy link
Collaborator

@buuhuu buuhuu commented Oct 23, 2025

Fixes #194

const baseUrl = getProductUrl(baseProduct, context);
if (Array.isArray(option.values)) {
option.values = option.values.map((value) => ({
...value,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Was this intentional removal of the spread? Figured you would just append title prop after if that's all you need.

Copy link
Collaborator Author

@buuhuu buuhuu Oct 29, 2025

Choose a reason for hiding this comment

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

I wanted to make sure that all values are sanitized, and hence removed any "deep copy" / spread.

The template reads only the title and url anyway so that is what I kept.

Copy link
Collaborator

@sirugh sirugh left a comment

Choose a reason for hiding this comment

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

I will not be able to validate/test but code looks fine. One comment regarding a change away from spreading of value props, otherwise LGTM.

if (!html) return html;

const allowedInlineTags = [ 'a', 'br', 'code', 'del', 'em', 'img', 'strong', 'sub', 'sup', 'u' ];
const allowedAllTags = [
Copy link
Collaborator

Choose a reason for hiding this comment

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

const allowedAllTags = [
'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ul', 'ol', 'li', 'pre',
'div', 'span', 'section', 'article',
'blockquote', 'cite', 'q',
'figure', 'figcaption',
...allowedInlineTags,
'table', 'tbody', 'td', 'th', 'thead', 'tr',
]; or we don't need all tags ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We only include what edge delivery supports https://www.aem.live/developer/markup-reference

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.

incorrect structure generated for some products

4 participants