ralfstuckert / pdfbox-layout

MIT License
155 stars 74 forks source link

Underlining and Strikethrough don't work at the same time. #82

Open Thejipppp opened 3 years ago

Thejipppp commented 3 years ago

(This is an edit, I wrote an issue for another library here, sorry for that)

Hi, firstly I would like to thank you for this great library!

I have found a little bug where text can not be underlined and strikethrough at the same time. I think the problem lies in the fact that they both have the same (ending) symbol which makes parsing really difficult. I personally fixed this by making strikethrough another symbol ("~~"). To be fair, I just copied the functionally of underlining and when both are needed, I make sure that I use ~~{0.25:} or ~~ {0.25:}, the symbols don't clash anymore and there isn't a problem anymore. The text is shown as "text that has to be both effects"

I have a screenshot from the easytable library to show the effect.

image


"Beneath is an example of __underscored__ and __{0.25:}striked through__ \n"
+ " __ __{0.25:}text, both at the same time__ __"