Skip to content

The start attribute of the ordered list is ignored #71

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

Closed
neupauer opened this issue Sep 14, 2020 · 5 comments · Fixed by #110
Closed

The start attribute of the ordered list is ignored #71

neupauer opened this issue Sep 14, 2020 · 5 comments · Fixed by #110

Comments

@neupauer
Copy link
Contributor

neupauer commented Sep 14, 2020

The start attribute of the ordered list ( MDN | The Ordered List element ) is ignored (reset).

<ol start="4">

</ol>

Reason:

ol: {
  counterReset: 'list-counter',
},

Possible solution in future (maybe):

ol: {
  counterReset: 'list-counter attr(start number, 0)',
},

But <type-or-unit> param for attr() is not supported today. Solution like #70 is not possieble due to start is not finite. Does anyone have an idea?

EDIT:
Maybe option to opt-in/out for custom/default list style option?

There is also an issue ( #56 ), where both are rendered - but it can illustrate what I mean, an option to enable/disable one of them.

@swyxio
Copy link

swyxio commented Sep 22, 2020

just ran into this today. we need some sort of opt out, or to fix this underlying issue!

@neupauer
Copy link
Contributor Author

In my opinion, the best solution right now is to display the default browser counter, and style it with the new pseudo-element ::marker (supported in all modern browsers).

Overriding the default counter introduce several issues:

  • <ol> attributes reversed, start and type are ignored
  • <ul> attribute type is ignored (type is deprecated, so not such an issue )
  • <li> attributes type and value are ignored (type is deprecated, so not such an issue )

I will prepare a PR

Links:
web.dev | ::marker

@mfullbrook
Copy link

I've run into this issue too. It's a real problem when using markup that's been converted from markdown - markdown uses the start attribute when putting code blocks between ordered list items.

@swyxio
Copy link

swyxio commented Oct 6, 2020

@adamwathan @simonswiss would you take a PR for this one?

@neupauer
Copy link
Contributor Author

I have also prepared an alternative solution to this issue ( see PR #85 ) - If someone needs a quick solution, it seems to be a pretty good alternative

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