material-awesome icon indicating copy to clipboard operation
material-awesome copied to clipboard

Automatic task-list truncation breaks with Pango tags

Open nununoisy opened this issue 6 years ago • 3 comments
trafficstars

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.

nununoisy avatar May 17 '19 14:05 nununoisy

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

PapyElGringo avatar May 18 '19 17:05 PapyElGringo

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

aislanmaia avatar May 22 '19 18:05 aislanmaia

@aislanmaia let's talk about it here #40

PapyElGringo avatar Jun 01 '19 08:06 PapyElGringo