… | |
… | |
34 | |
34 | |
35 | return unless @BOOKS; |
35 | return unless @BOOKS; |
36 | |
36 | |
37 | my ($title, @body) = @{$BOOKS[rand @BOOKS]}; |
37 | my ($title, @body) = @{$BOOKS[rand @BOOKS]}; |
38 | |
38 | |
|
|
39 | # half-assed attempt to make it a single line text-only title |
39 | $title = cf::pod::as_text [$title]; |
40 | $title = cf::pod::as_cfpod [$title]; |
40 | $title =~ s/\n/ /g; |
41 | $title =~ s/\n/ /g; |
41 | $title =~ s/ +$//; |
42 | $title =~ s/ +$//; |
|
|
43 | $title =~ s/B<([^>]*)>/$1/g; |
42 | |
44 | |
43 | $book->name ($title); |
45 | $book->name ($title); |
44 | $book->name_pl ($title); |
46 | $book->name_pl ($title); |
45 | $book->title (undef); |
47 | $book->title (undef); |
46 | $book->msg (cf::pod::as_text \@body); |
48 | $book->msg (cf::pod::as_cfpod \@body); |
47 | } |
49 | } |
48 | |
50 | |