material-shell / material-awesome

Material and Mouse driven config for AwesomeWM 4.3
MIT License
686 stars 243 forks source link

Automatic task-list truncation breaks with Pango tags #38

Open nununoisy opened 5 years ago

nununoisy commented 5 years ago

Sometimes when receiving a title, it contains Pango tags. A simple window title that breaks the parser is " + Why doesn’t this work?????????????" It’s long enough to trigger the shortener, which is quite simple:

text = text:gsub(">(.-)<", ">" .. textOnly:sub(1,21) .. "...<")

Unfortunately, sometimes when Pango tags are used, the text is truncated to "+ Why does&a" (the &a is a fragment from the apostrophe). Then set_markup_silently(text) fails and the box simply says Invalid Text. Even if it succeeded, the text inside would be much shorter than intended.

I’m suspecting we may need gears.string.xml_escape(), but then the title loses formatting. We might need an extra parsing library for this.

PapyElGringo commented 5 years ago

Well nice catch didn't noticed this kind of behavior but I mainly use the same software daily. I would need to dig in it but unfortunately Im a bit short in available time. Im working actively in the in the V2 of the project. So if someone want to try to find a fix for this ? I'll be happy to take PR.

Thanks all

aislanmaia commented 5 years ago

Hey @PapyElGringo you have some preview of V2 ? At least something like bullet topics for what V2 will bring?

PapyElGringo commented 5 years ago

@aislanmaia let's talk about it here #40