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

Have a means of marking HTML elements as safe to copy #1120

Closed
christianp opened this issue Sep 26, 2024 · 0 comments · May be fixed by #1126
Closed

Have a means of marking HTML elements as safe to copy #1120

christianp opened this issue Sep 26, 2024 · 0 comments · May be fixed by #1126
Labels

Comments

@christianp
Copy link
Member

When you have an HTML element in a question variable, it's easy to try to embed the same element twice in two different places.

It isn't always safe to copy an HTML element because it might have javascript event listeners attached to it.

It should be possible to mark an HTML element as 'non-interactive', which would mean it's safe to copy. Elements created with the html and table functions should have this mark automatically.

Then, when they're inserted into a content area, a copy would be taken.

christianp added a commit that referenced this issue Oct 24, 2024
fixes #1120

HTML elements with the attribute `data-interactive="false"` are
considered to be noninteractive and can be safely copied before
embedding in content areas.

The `table`, `html`, `image` and `scientificnumberhtml` functions add
this attribute to the elements that they create.

Need to document this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant