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

Added support for rendering enumerations in ordered lists and for list-style #1320

Merged
merged 1 commit into from Dec 21, 2017

Conversation

matthias-christen
Copy link
Contributor

@matthias-christen matthias-christen commented Dec 15, 2017

Summary

This PR adds support for rendering the enumerations (bullets, numbers, etc.) in ordered and unordered lists and for list style images.
For the actual formatting, an external package is used (https://www.npmjs.com/package/liststyletype-formatter), I hope that's OK.

This PR fixes/implements the following bugs/features

  • Feature: support for rendering enumerations in (un)ordered lists (list-style-type, list-style-position, list-style-image)

Explain the motivation for making this change. What existing problem does the pull request solve?

More accurate rendering of (un)ordered lists.

Test plan (required)

Added tests/reftests/list/liststyle.html, which tests some more list styles in addition to the already existing tests, in the tests/reftests/list folder.

Closing issues

Fixes #177
Fixes #308

@niklasvh
Copy link
Owner

niklasvh commented Dec 18, 2017

Thanks for the PR! I started looking through this over the weekend.

Few things that need to be resolved (which I started fixing already):

  • The list style should not be tied to LI tagName but instead display: list-item as a div or any other element can have a list item just as long as its display is list-item same way a LI won't have a list item if you change it's display.
  • Supporting all the different variants of list styles without any build time options to selectively choose which ones/languages to support might increase the package size excessively without much gain. Same applies with changes to word-break etc support for different languages where I was planning on tackling that issue. Ancient versions of html2canvas had list style support, with a few of the variants supported: https://github.com/niklasvh/html2canvas/blob/0.4.1/src/Generate.js#L391
  • Move the list style parsing out of ListItem and into parsing/listStyle

As said I am working on fixing those issues already so no need to change the PR.

@niklasvh niklasvh merged commit 7335984 into niklasvh:master Dec 21, 2017
@andersborgabiro
Copy link

At least I'd be happy to be able to apply at least unordered bullets at all, without too much "magic", as in my case a user edits content via TinyMCE. It's possible to apply custom styles to tags, as long as "li" is used (as that's what a user chooses in the toolbar) rather than something else completely.

@niklasvh
Copy link
Owner

All types of list-style are supported for now, smaller subsets with specific languages will be worked with the word breaking and other language dependent features.

@andersborgabiro
Copy link

andersborgabiro commented Dec 21, 2017

Great! Something fun to evaluate during the holidays :).

@tininess
Copy link

tininess commented Nov 7, 2018

All types of list-style are supported for now, smaller subsets with specific languages will be worked with the word breaking and other language dependent features.

I using the newest pre-release but not work :( https://jsfiddle.net/boLxkgj8/265/

@RUSSCITY
Copy link

All types of list-style are supported for now, smaller subsets with specific languages will be worked with the word breaking and other language dependent features.

I using the newest pre-release but not work :( https://jsfiddle.net/boLxkgj8/265/

ok, you was not using the latest version, now it looks like it works:
https://jsfiddle.net/jeavhg05/4/

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.

List style images are missing Bullets are not rendered
5 participants