aboutsummaryrefslogtreecommitdiffstats
path: root/AdminPanel/Rpmdragora/formatting.pm
diff options
context:
space:
mode:
authorMatteo Pasotti <matteo@mageia.org>2013-01-11 01:26:26 +0000
committerMatteo Pasotti <matteo@mageia.org>2013-01-11 01:26:26 +0000
commit96eb75a0db4fd879415f21b2b38a2c2927e50d43 (patch)
treea67599d3452e4f2fd6c9e4a5e8ce4a3e12736b19 /AdminPanel/Rpmdragora/formatting.pm
parent2e0f9b70beecb7bdd27e74088368936cdb718c72 (diff)
downloadcolin-keep-96eb75a0db4fd879415f21b2b38a2c2927e50d43.tar
colin-keep-96eb75a0db4fd879415f21b2b38a2c2927e50d43.tar.gz
colin-keep-96eb75a0db4fd879415f21b2b38a2c2927e50d43.tar.bz2
colin-keep-96eb75a0db4fd879415f21b2b38a2c2927e50d43.tar.xz
colin-keep-96eb75a0db4fd879415f21b2b38a2c2927e50d43.zip
- gui.pm: rewritten set_node_state, set_leaf_state
- gui.pm: added subroutines group_tree, group_has_parent, group_parent - formatting.pm: imported escape_text_for_TextView_markup_format from ugtk2 - rpmdragora: added tree_callback
Diffstat (limited to 'AdminPanel/Rpmdragora/formatting.pm')
-rw-r--r--AdminPanel/Rpmdragora/formatting.pm14
1 files changed, 14 insertions, 0 deletions
diff --git a/AdminPanel/Rpmdragora/formatting.pm b/AdminPanel/Rpmdragora/formatting.pm
index 3d650a4..ccbdf0c 100644
--- a/AdminPanel/Rpmdragora/formatting.pm
+++ b/AdminPanel/Rpmdragora/formatting.pm
@@ -29,6 +29,7 @@ use utf8;
use POSIX qw(strftime);
use AdminPanel::rpmdragora;
use lib qw(/usr/lib/libDrakX);
+use MDK::Common::Various; # included for internal_error subroutine
use common;
#use ugtk2 qw(escape_text_for_TextView_markup_format);
@@ -54,6 +55,19 @@ our @EXPORT = qw(
);
+sub escape_text_for_TextView_markup_format {
+ my ($str) = @_;
+ my %rules = ('&' => '&amp;',
+ '<' => '&lt;',
+ '>' => '&gt;',
+ );
+ eval { $str =~ s!([&<>])!$rules{$1}!g }; #^(&(amp|lt|gt);)!!) {
+ if (my $err = $@) {
+ internal_error("$err\n$str");
+ }
+ $str;
+}
+
# from rpmtools, #37482:
sub ensure_utf8 {
if (utf8::is_utf8($_[0])) {