Gtk2::Ex::MarkupTextBuffer
- From: "Kevin C. Krinke" <kckrinke opendoorsoftware com>
- To: gtk-perl-list gnome org
- Subject: Gtk2::Ex::MarkupTextBuffer
- Date: Fri, 04 Feb 2005 16:35:11 -0500
Hi all,
I'm currently building a module as a subclass of Gtk2::TextBuffer that
will allow you to $buffer->set_markup( $pango_markup ).
The issue I'm having right now is deciding how to implement the XML
string parsing.
Currently I've got a semi-working setup but it requires a patched
version of XML::Mini. I don't like this situation and am considering
writing a simplified parser. The issue with XML::Mini is that it does
not maintain prefixing/suffixing whitespace very well.
An example of the XML::Mini whitespace issue:
Markup: 'Some <span foreground="blue">blue</span> text.'
Becomes: 'Someblue text.'
The tagging and colouring works just fine but the whitespace makes for
an illegible text buffer :(
Does anyone have any suggestions as to other CPAN XML modules that
preserve prefixing and suffixing whitespace of tagged contents?
Things I've tried so far:
- XML::Simple - is just that, way too simple... can't even reliably
preserve text flow let alone whitespace.
- Text::Balanced - this is my last resort, means I need to basically
write an XML parser from scratch that does only what is needed.
Seemingly the best solution but this also requires the most work.
PS: The name Gtk2::Ex::MarkupTextBuffer is not set in stone, any
suggestions as to a better name are welcome :) I didn't want to use
"Pango" in the name as I'd like to include non-pango-standard tags like
<b><i><u> etc.
--
Kevin C. Krinke <kckrinke opendoorsoftware com>
Open Door Software Inc.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]