https://bugzilla.novell.com/show_bug.cgi?id=691572
https://bugzilla.novell.com/show_bug.cgi?id=691572#c38
--- Comment #38 from Gabriele Mohr
I don't think libzypp is the right place for this. But also not the job of the concrete UI implementations.
Giving the fact that our current YRichText::setText() implementation assumes you are giving (simplified) HTML (unless setTextMode() is enabled) I would keep the magic in this area. Therefore libyui currently assumes that a concrete UI Foo implementation is handling HTML in FooRichText. I agree, libyui is the right place to add a markdown parser.
I would add a C/C++ markdown parser to libyui, and modify setText so that if <!-- DT:Rich --> is found at the beginning then the text is set "as is" (assumed HTML). We can detect it in other ways as well. Also, AFAIK, html is valid markdown, so we could just process the text always.
Currently the <!-- DT:Rich --> tag is not used in YaST (YCP code) to indicate html text, i.e. we have to detect html in another way.
If not, we assume it is markdown, and process the text.
The disadvantage of having the conversion in YRichText::setText() is that not all text passed to it IS written in markdown syntax (e.g. licenses). I propose to add a method createHmtlText() which can be called only if needed, e.g. in ncurses package selector for package and patch descriptions. Disadvantage of this approach is, of course that's not available from YCP.
We need to verify that ncurses can cope with the markdown parser HTML output, or at least it can ignore the unknown tags. This should be OK.
If setTextMode is enabled and the text does not contain <!-- DT:Rich --> then we set the text unprocessed.
Now, IIRC, the Qt selector does not use the libyui widget, but the ncurses one does, right?
-- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.