Skip to content

Preserve ordered list starting number#713

Closed
mdiebolt wants to merge 4 commits intobasecamp:mainfrom
polleverywhere:main
Closed

Preserve ordered list starting number#713
mdiebolt wants to merge 4 commits intobasecamp:mainfrom
polleverywhere:main

Conversation

@mdiebolt
Copy link
Copy Markdown

At Poll Everywhere we have a use-case where we have multiple Lexxy editors on the same page representing choices to a multiple choice question. Our customers want to be able to mark choices with 1., 2., 3. and have them styled as a list.

Prior to this change the editor rendered the lists as authored but on save the list element start attribute would get sanitized away, resulting in each choice showing 1..

This PR adds start to both the DOM purify and ActionText attribute allowlists.

Before
before

After
after

mdiebolt and others added 4 commits January 21, 2026 22:17
In order for `ol` list elements to respect the numbers they were authored with we need to make sure that the `start` attribute makes it through dom_purify
@mdiebolt
Copy link
Copy Markdown
Author

mdiebolt commented Feb 9, 2026

@samuelpecher is this type of thing something y’all would be open to incorporating into Lexxy?

@samuelpecher
Copy link
Copy Markdown
Collaborator

@mdiebolt I think the right direction here would be to make a configuration path to allow more attributes so each application can customize for their own needs rather than upstream all the required attributes into core Lexxy

@jorgemanrubia
Copy link
Copy Markdown
Member

Yes I agree with @samuelpecher. It would be great to make this configurable instead of hard-coded

adam-h added a commit to polleverywhere/lexxy that referenced this pull request Mar 27, 2026
Add an `additionalAllowedAttributes` option that lets apps specify extra HTML
attributes to preserve through both DOMPurify (client) and Action Text
sanitization (server).

Rails apps configure this in one place via
`config.lexxy.additional_allowed_attributes`. The gem emits the setting
onto each rendered `<lexxy-editor>` element so a separate JS
`Lexxy.configure` call is not needed. Non-Rails apps can use the editor
preset or element attribute directly.

This is a follow-on to basecamp#713 making
the solution generic rather than specific to list 'start' attributes.
adam-h added a commit to polleverywhere/lexxy that referenced this pull request Mar 27, 2026
Add an `additionalAllowedAttributes` option that lets apps specify extra HTML
attributes to preserve through both DOMPurify (client) and Action Text
sanitization (server).

Rails apps configure this in one place via
`config.lexxy.additional_allowed_attributes`. The gem emits the setting
onto each rendered `<lexxy-editor>` element so a separate JS
`Lexxy.configure` call is not needed. Non-Rails apps can use the editor
preset or element attribute directly.

This is a follow-on to basecamp#713 making
the solution generic rather than specific to list 'start' attributes.
@adam-h
Copy link
Copy Markdown

adam-h commented Mar 27, 2026

I took a stab at making this configurable in #925

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.

4 participants