-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Ordered lists do not support list types (a
, A
, i
and I
)
#3726
Comments
Also as an update to this, Google Docs does not carry the ordered list's I have update the link above to our implementation which contains this fix as well. Here is an example document you can try copying from: When copied to clipboard, this produces the following HTML: <meta charset="utf-8"><b style="font-weight:normal;" id="docs-internal-guid-ea08f363-7fff-0635-f25d-5f6d2ddc7d51"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;"><span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Pasting list with styles</span></p><ol style="margin-top:0;margin-bottom:0;padding-inline-start:48px;"><li dir="ltr" style="list-style-type:decimal;font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:700;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;" aria-level="1"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;" role="presentation"><span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:700;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Item 1</span></p></li><ol style="margin-top:0;margin-bottom:0;padding-inline-start:48px;"><li dir="ltr" style="list-style-type:lower-alpha;font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;" aria-level="2"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;" role="presentation"><span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Subitem 1</span></p></li><li dir="ltr" style="list-style-type:lower-alpha;font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;" aria-level="2"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;" role="presentation"><span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Subitem 2</span></p></li><li dir="ltr" style="list-style-type:lower-alpha;font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;" aria-level="2"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;" role="presentation"><span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Subitem 3</span></p></li></ol><li dir="ltr" style="list-style-type:decimal;font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:700;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;" aria-level="1"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;" role="presentation"><span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:700;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Item 2</span></p></li><ol style="margin-top:0;margin-bottom:0;padding-inline-start:48px;"><li dir="ltr" style="list-style-type:lower-alpha;font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;" aria-level="2"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;" role="presentation"><span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Subitem 1</span></p></li><li dir="ltr" style="list-style-type:lower-alpha;font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;" aria-level="2"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;" role="presentation"><span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Subitem 2</span></p></li><li dir="ltr" style="list-style-type:lower-alpha;font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;" aria-level="2"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;" role="presentation"><span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Subitem 3</span></p></li></ol></ol></b> It carries the |
@ahukkanen but the extension still does not support when the user manually indents the sub items based on the indent level right ?. Do you think we need to take care of it as well ? But this same problem has been solved by |
@gethari Yes, that is not supported by the extension currently. I'm not sure if we want to support that either, there are a bit of differences how different editors work in this regard. For example, LibreOffice does not change the list style automatically for the sub-list items unless the user changes it themselves. What I'm thinking is that maybe we could provide some keyboard shortcut for changing the list style on the fly. I have to investigate a bit about different editors and if they provide any commonly known shortcut for this. Or alternatively, we can add a toolbar control to change the list style for ordered lists. EDIT: The keyboard shortcuts has been added to the extension and the link to the extension is also updated. There did not seem to be a generic convention for this, so we went with |
We found out another issue with the ordered lists with a
This should be eventually fixed as the case sensitive selector modifier was accepted to the CSS specification as per: As a workaround, we decided to add a secondary |
This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days |
This is still relevant. |
bump |
You can edit your css like so if you know you want a nested ordered lists to be letters:
I think |
Bump |
What’s the bug you are facing?
When you create an ordered list with some
type
(alphabet order, roman numerals), these list types are disappearing when this kind of content is entered to Tiptap.This is typical behavior for example when copying content from a desktop rich text editor program.
For further reference, see the documentation for the
type
attribute for ordered lists:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ol
This is a valid attribute with one of those values described on that page.
Which browser was this experienced in? Are any special extensions installed?
Chrome 109.0.5414.119
How can we reproduce the bug on our side?
Create the following kind of text in a desktop rich text editor (e.g. LibreOffice, MS Office):
When using LibreOffice Writer, this content would produce the following HTML when copied and pasted to a
contenteditable
area:Copy this content from the rich text editor and paste it to Tiptap.
Can you provide a CodeSandbox?
https://jsfiddle.net/69utomky/
Note that here I am replicating the list content as described above as the initial content for the editor, so that you are able to see the behavior directly.
What did you expect to happen?
I would expect the valid ordered list
type
attributes to be preserved in the final markup.As defined by the spec, the valid values are
a
,A
,i
andI
.The default type of
1
does not need to be supported as that is the default anyways.Anything to add? (optional)
I fixed this in our implementation with the following extension to the
OrderedList
extension:https://github.com/decidim/decidim/blob/e8d1f7eb691b8cb882d345a932d08888a8a6f443/decidim-core/app/packs/src/decidim/editor/extensions/ordered_list/index.js
Did you update your dependencies?
Are you sponsoring us?
The text was updated successfully, but these errors were encountered: