Ordered list (<ol>) start attribute not applied #398

Closed
aih opened this Issue Dec 6, 2016 · 5 comments

Comments

Projects
None yet
2 participants
@aih

aih commented Dec 6, 2016

Using weasyprint 0.32, I'm converting a source with this form:

<ol class="arabic" start="3">
    <li>
        <p>The third way to accomplish this is...</p>
    </li>
</ol>

And it is being rendered:

1. The third way to accomplish this is...

The 'start' attribute is not being applied.

@liZe

This comment has been minimized.

Show comment
Hide comment
@liZe

liZe Dec 6, 2016

Member

It should be managed by https://github.com/Kozea/WeasyPrint/blob/master/weasyprint/css/__init__.py#L445, I have to check why it's not working (and add a test).

Member

liZe commented Dec 6, 2016

It should be managed by https://github.com/Kozea/WeasyPrint/blob/master/weasyprint/css/__init__.py#L445, I have to check why it's not working (and add a test).

liZe added a commit that referenced this issue Dec 6, 2016

@liZe

This comment has been minimized.

Show comment
Hide comment
@liZe

liZe Dec 6, 2016

Member

It's actually working, but:

  • you need to enable the "presentational hints" options (using the -p option from the CLI, or setting the presentational_hints option of the render* methods from the API),
  • there's a bug in 0.32 and 0.33 (fixed by 12c297d) that's preventing the presentational hints to be honored when you render PDFs. That's a dirty bug, I'm sorry 😞.

So, you can see that it works right now with 0.32 using weasyprint -p file.html file.png. Unfortunately, if you want to generate PDFs, you'll have to wait for 0.34 or backport 12c297d

Member

liZe commented Dec 6, 2016

It's actually working, but:

  • you need to enable the "presentational hints" options (using the -p option from the CLI, or setting the presentational_hints option of the render* methods from the API),
  • there's a bug in 0.32 and 0.33 (fixed by 12c297d) that's preventing the presentational hints to be honored when you render PDFs. That's a dirty bug, I'm sorry 😞.

So, you can see that it works right now with 0.32 using weasyprint -p file.html file.png. Unfortunately, if you want to generate PDFs, you'll have to wait for 0.34 or backport 12c297d

@liZe liZe closed this Dec 6, 2016

@aih

This comment has been minimized.

Show comment
Hide comment
@aih

aih Dec 6, 2016

Thank you for your fast work on this! It may be worth adding a note to the 'presentational hints' section of the documentation-- I did not know what presentational attributes were and didn't think it would be relevant in this case. Something like:

Presentational hints include a wide array of attributes that direct styling in html, including font @color names and @size attribute, list attributes (@type and @start), various table alignment attributes, and others. If the pdf is missing some of the features you expect from the html, try running weasyprint with the -p option.

aih commented Dec 6, 2016

Thank you for your fast work on this! It may be worth adding a note to the 'presentational hints' section of the documentation-- I did not know what presentational attributes were and didn't think it would be relevant in this case. Something like:

Presentational hints include a wide array of attributes that direct styling in html, including font @color names and @size attribute, list attributes (@type and @start), various table alignment attributes, and others. If the pdf is missing some of the features you expect from the html, try running weasyprint with the -p option.

@aih

This comment has been minimized.

Show comment
Hide comment
@aih

aih Dec 6, 2016

I cloned the repo with 12c297d, installed locally, and can confirm it works. Thanks again!

aih commented Dec 6, 2016

I cloned the repo with 12c297d, installed locally, and can confirm it works. Thanks again!

liZe added a commit that referenced this issue Dec 6, 2016

@liZe

This comment has been minimized.

Show comment
Hide comment
@liZe

liZe Dec 6, 2016

Member

It may be worth adding a note to the 'presentational hints' section of the documentation.

Done, thank you for the report!

Member

liZe commented Dec 6, 2016

It may be worth adding a note to the 'presentational hints' section of the documentation.

Done, thank you for the report!

jsonn pushed a commit to jsonn/pkgsrc that referenced this issue Jan 15, 2017

kleink
Update py-weasyprint to 0.34.
Version 0.34
------------

Released on 2016-12-21.

Bug fixes:

* `#398 <Kozea/WeasyPrint#398>`_:
  Honor the presentational_hints option for PDFs.
* `#399 <Kozea/WeasyPrint#399>`_:
  Avoid CairoSVG-2.0.0rc* on Python 2.
* `#396 <Kozea/WeasyPrint#396>`_:
  Correctly close files open by mkstemp.
* `#403 <Kozea/WeasyPrint#403>`_:
  Cast the number of columns into int.
* Fix multi-page multi-columns and add related tests.


Version 0.33
------------

Released on 2016-11-28.

New features:

* `#393 <Kozea/WeasyPrint#393:
  Add tests on MacOS.
* `#370 <Kozea/WeasyPrint#370>`_:
  Enable @font-face on MacOS.

Bug fixes:

* `#389 <Kozea/WeasyPrint#389>`_:
  Always update resume_at when splitting lines.
* `#394 <Kozea/WeasyPrint#394>`_:
  Don't build universal wheels.
* `#388 <Kozea/WeasyPrint#388>`_:
  Fix logic when finishing block formatting context.


Version 0.32
------------

Released on 2016-11-17.

New features:

* `#28 <Kozea/WeasyPrint#28>`_:
  Support @font-face on Linux.
* Support CSS fonts level 3 almost entirely, including OpenType features.
* `#253 <Kozea/WeasyPrint#253>`_:
  Support presentational hints (optional).
* Support break-after, break-before and break-inside for pages and columns.
* `#384 <Kozea/WeasyPrint#384:
  Major performance boost.

Bux fixes:

* `#368 <Kozea/WeasyPrint#368>`_:
  Respect white-space for shrink-to-fit.
* `#382 <Kozea/WeasyPrint#382>`_:
  Fix the preferred width for column groups.
* Handle relative boxes in column-layout boxes.

Documentation:

* Add more and more documentation about Windows installation.
* `#355 <Kozea/WeasyPrint#355:
  Add fonts requirements for tests.


Version 0.31
------------

Released on 2016-08-28.

New features:

* `#124 <Kozea/WeasyPrint#124>`_:
  Add MIME sniffing for images.
* `#60 <Kozea/WeasyPrint#60>`_:
  CSS Multi-column Layout.
* `#197 <Kozea/WeasyPrint#197>`_:
  Add hyphens at line breaks activated by a soft hyphen.

Bux fixes:

* `#132 <Kozea/WeasyPrint#132>`_:
  Fix Python 3 compatibility on Windows.

Documentation:

* `#329 <Kozea/WeasyPrint#329>`_:
  Add documentation about installation on Windows.


Version 0.30
------------

Released on 2016-07-18.

WeasyPrint now depends on html5lib-0.999999999.

Bux fixes:

* Fix Acid2
* `#325 <Kozea/WeasyPrint#325>`_:
  Cutting lines is broken in page margin boxes.
* `#334 <Kozea/WeasyPrint#334>`_:
  Newest html5lib 0.999999999 breaks rendering.


Version 0.29
------------

Released on 2016-06-17.

Bug fixes:

* `#263 <Kozea/WeasyPrint#263:
  Don't crash with floats with percents in positions.
* `#323 <Kozea/WeasyPrint#323>`_:
  Fix CairoSVG 2.0 pre-release dependency in Python 2.x.


Version 0.28
------------

Released on 2016-05-16.

Bug fixes:

* `#189 <Kozea/WeasyPrint#189>`_:
  ``white-space: nowrap`` still wraps on hyphens
* `#305 <Kozea/WeasyPrint#305>`_:
  Fix crashes on some tables
* Don't crash when transform matrix isn't invertible
* Don't crash when rendering ratio-only SVG images
* Fix margins and borders on some tables


Version 0.27
------------

Released on 2016-04-08.

New features:

* `#295 <Kozea/WeasyPrint#295>`_:
  Support the 'rem' unit.
* `#299 <Kozea/WeasyPrint#299>`_:
  Enhance the support of SVG images.

Bug fixes:

* `#307 <Kozea/WeasyPrint#307>`_:
  Fix the layout of cells larger than their tables.

Documentation:

* The website is now on GitHub Pages, the documentation is on Read the Docs.
* `#297 <Kozea/WeasyPrint#297>`_:
  Rewrite the CSS chapter of the documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment