KNotificationItem specification - first draft

Aurélien Gâteau aurelien.gateau at canonical.com
Wed Sep 9 00:20:54 PDT 2009


Aaron J. Seigo wrote:
> On September 8, 2009, you wrote:
>> Aaron J. Seigo wrote:
>>>>>> or:
>>>>>> State that if an item wishes to use markup, then it must enclose the
>>>>>> whole text in a <markup> tag.
>>>>> that would work as well. it's a small amount of overhead for not much
>>>>> pain. it could also be that we look for the "<pre>" tag instead, and
>>>>> make markup the default.
>>>> Doing it this way is not good. It can fail in the (admittedly rare) case
>>>> where the plain text contains the closing tag.
>>> how is that different from using <markup>? this just says that rich text
>>> is the default, and if you want plain text to use <pre> around your text.
>> Imagine an application which does not markup, but shows text which is
>> not known at compile time. From the app point of view, it uses some a
>> "template like this:
>>
>> <pre>Static text\n%1\nMore static text</pre>
>>
>> Then in the (admittedly rare) case where %1 is "Foo</pre>", your text is
>> cut. Unless of course you do not check for the closing tag, which
>> (thinking aloud) you don't really need to... but it feels a bit more
>> hackish than having to escape markup.
> 
> this is no different if the default is "you must preface with <markup>" and 
> the rare case where the input starts with <markup> :)

The difference I see is that an application which takes care of adding 
the <markup> tag most likely have the correct code in place to escape 
the '<' and '>' characters, whereas an application sending plain text 
most likely will not look at the content it sends.

Aurelien


More information about the xdg mailing list