diff options
author | Thierry Vignaud <tv@mandriva.org> | 2008-02-08 15:58:37 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2008-02-08 15:58:37 +0000 |
commit | 6061f17e5324cd123bb7f49d5d262bb02cfa72f0 (patch) | |
tree | a34b60227cc03ce9d747115f370af3abc765b018 /Rpmdrake/formatting.pm | |
parent | 9e56a3feea25bb79c9dddeefca089d2af7df28e1 (diff) | |
download | rpmdrake-6061f17e5324cd123bb7f49d5d262bb02cfa72f0.tar rpmdrake-6061f17e5324cd123bb7f49d5d262bb02cfa72f0.tar.gz rpmdrake-6061f17e5324cd123bb7f49d5d262bb02cfa72f0.tar.bz2 rpmdrake-6061f17e5324cd123bb7f49d5d262bb02cfa72f0.tar.xz rpmdrake-6061f17e5324cd123bb7f49d5d262bb02cfa72f0.zip |
(format_changelog_string) make a real function out of a closure
Diffstat (limited to 'Rpmdrake/formatting.pm')
-rw-r--r-- | Rpmdrake/formatting.pm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Rpmdrake/formatting.pm b/Rpmdrake/formatting.pm index 911819f9..3b987c67 100644 --- a/Rpmdrake/formatting.pm +++ b/Rpmdrake/formatting.pm @@ -34,6 +34,8 @@ use ugtk2 qw(escape_text_for_TextView_markup_format); use Exporter; our @ISA = qw(Exporter); our @EXPORT = qw( + $spacing + format_changelog_string format_field format_header format_name_n_summary @@ -93,6 +95,12 @@ sub pkg2medium { #- encodings; but if a user has a so broken setup we can't do much anyway sub localtime2changelog { to_utf8(POSIX::strftime("%c", localtime($_[0]))) } +our $spacing = " "; +sub format_changelog_string { + #- preprocess changelog for faster TextView insert reaction + [ map { [ "$spacing$_\n", if_(/^\*/, { 'weight' => Gtk2::Pango->PANGO_WEIGHT_BOLD }) ] } split("\n", $_[0]) ]; +} + sub format_update_field { my ($name) = @_; '<i>' . eval { escape_text_for_TextView_markup_format($name) } . '</i>'; |