From b9a4e9c8a68dcb6b17617f4f7a5ad5ad3298bfa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 9 Mar 2016 22:05:38 +0100 Subject: Imported Upstream version 1.7.1 --- lib/gcstar/GCPlugins/GCgames/GCJeuxVideoFr.pm | 78 +++++++++++++++++++++++++-- 1 file changed, 74 insertions(+), 4 deletions(-) (limited to 'lib/gcstar/GCPlugins/GCgames/GCJeuxVideoFr.pm') diff --git a/lib/gcstar/GCPlugins/GCgames/GCJeuxVideoFr.pm b/lib/gcstar/GCPlugins/GCgames/GCJeuxVideoFr.pm index bec266f..e81d116 100644 --- a/lib/gcstar/GCPlugins/GCgames/GCJeuxVideoFr.pm +++ b/lib/gcstar/GCPlugins/GCgames/GCJeuxVideoFr.pm @@ -2,7 +2,7 @@ package GCPlugins::GCgames::GCJeuxVideoFr; ################################################### # -# Copyright 2005-2011 Tian +# Copyright 2005-2014 Tian # # This file is part of GCstar. # @@ -69,6 +69,18 @@ use GCPlugins::GCgames::GCgamesCommon; } elsif ($self->{parsingTips}) { + if ($tagname eq 'tpfdebuttpf') + { + $self->{isTip} = 1; + } + elsif (($tagname eq 'p') && ($self->{isTip} ne 0 )) + { + $self->{isTip} = 2; + } + elsif ($tagname eq 'tpffintpf') + { + $self->{isTip} = 0; + } } else { @@ -235,6 +247,26 @@ use GCPlugins::GCgames::GCgamesCommon; } elsif ($self->{parsingTips}) { + # Enleve les blancs en debut de chaine + $origtext =~ s/^\s+//; + # Enleve les blancs en fin de chaine + $origtext =~ s/\s+$//; + if ($self->{isTip} eq 2) + { + chomp($origtext); + $self->{curInfo}->{secrets} .= "\n" if $self->{curInfo}->{secrets}; + $self->{curInfo}->{secrets} .= $origtext; + $self->{isTip} = 1; + } + elsif ($self->{isTip} eq 1) + { + chomp($origtext); + if ( ($self->{curInfo}->{secrets}) && ($origtext ne "") ) + { + $self->{curInfo}->{secrets} .= "" + } + $self->{curInfo}->{secrets} .= $origtext; + } } else { @@ -358,6 +390,8 @@ use GCPlugins::GCgames::GCgamesCommon; } elsif ($self->{parsingTips}) { + $html =~ s|