OpenSlides / openslides-client

Webclient for OpenSlides 4+
MIT License
3 stars 32 forks source link

Motion pdf export: Multiple formatting is ignored #3889

Closed MSoeb closed 3 months ago

MSoeb commented 3 months ago

Describe the bug: The pdf export of motions does not work correctly if a text passage has more than one formatting options activated at the same time (e.g. cursive and bold). Only one formatting is exported. A cursive and bold word would only be cursive or would only be bold.

How to Reproduce:

  1. open meeting
  2. open motion
  3. create motion > mark text with bold and striketrough* > save
  4. export motion as pdf

*This is an example. Several other combinations didn't work well. Please check them. The images below show as an example, what does work and what not. But these are not all possible options.

Expected behaviour Every text formatting combination should be exported in the pdf export.

Additional context Example Motion Text: image

Example of this motions text as pdf export: image

reiterl commented 3 months ago

Used step-by-step description of the issue:

  1. open meeting
  2. open motion
  3. create motion > mark text with bold and underline > save
  4. export motion as pdf

So the "bold and underline" case. Oh, it works correct.

MSoeb commented 3 months ago

Sorry, my mistake. I've described something which works correctly.

I've corrected the reproduction to an example which could also been seen in the images in line 6-7. The text is bold und striketrough in the motion view, but in the export it is only bold.

Elblinator commented 3 months ago

The strikethrough seems to be the format which always causes issues: strik + bold => bold strik + italic => nothiing strik + font colour => nothing strik + background colour => background colour bold + underline + strik => bold bold + italic + strik => bold + italic

other formats which sometimes cause problems: font colour underline italic

I did not test everything

reiterl commented 3 months ago

Mmh, one problem seems to be the 'html-to-pdf.service'. Transfer HTML string into a doc which the pdfMake part understands, can be tricky.

reiterl commented 3 months ago

Tested with my PR: (single) bold, italic, underline, strike-through, text-color, background-color, bullet point and number are there. So these html tags and styles are not missing in html_to_pdf.

reiterl commented 3 months ago

Tested mixed combinations. Passed. @Elblinator If one combination is still wrong, please write it down.