From: Ian Jackson Date: Tue, 1 Sep 2009 15:31:17 +0000 (+0100) Subject: Cope with some features of the Cobalt WP chart X-Git-Tag: 3.4~39 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.web-live.git;a=commitdiff_plain;h=243aacd694064310880840502e5fd4dba729dd0a;ds=sidebyside Cope with some features of the Cobalt WP chart --- diff --git a/yarrg/yppedia-chart-parser b/yarrg/yppedia-chart-parser index a093a0c..b35d816 100755 --- a/yarrg/yppedia-chart-parser +++ b/yarrg/yppedia-chart-parser @@ -118,7 +118,7 @@ sub yppedia_chart_parse () { s/\<--.*--\>//g; s/^\s*//; chomp; s/\s+$//; s/\s+/ /g; s/\<\/?(?:b|em)\>//g; - s/\{\{Chart\ style\|[^{}]*\}\}//g; + s/\{\{chart\ style\|[^{}]*\}\}//gi; next unless m/\{\{/; # only interested in chart template stuff my ($x,$y, $arch,$island,$solid,$dirn); @@ -126,9 +126,9 @@ sub yppedia_chart_parse () { if (($x,$y,$arch) = m/^\{\{ chart\ label \|(\d+)\|(\d+)\| .* - (?: \)? \'+ + (?: \<(?: big|center )\>)* \'+ \[\[ [^][\']* \| ([^][\'|]+)\ archipelago \]\] - \'+ (?: \<\/big\>)? \}\}$/xi) { + \'+ (?: \<\/(?: big|center )\>)* \}\}$/xi) { printf DEBUG "%2d,%-2d arch %s\n", $x,$y,$arch; push @wiarchlabels, [ $x,$y,$arch ]; } elsif (m/^\{\{ chart\ label \|\d+\|\d+\| diff --git a/yarrg/yppedia-ocean-scraper b/yarrg/yppedia-ocean-scraper index 30d0c4a..ad35c4d 100755 --- a/yarrg/yppedia-ocean-scraper +++ b/yarrg/yppedia-ocean-scraper @@ -89,6 +89,7 @@ def parse_chart(): debug('s',s) s = regexp.sub(r'\<\;', '<', s) s = regexp.sub(r'\>\;', '>', s) + s = regexp.sub(r'\"\;', '"', s) s = regexp.sub(r'\&\;', '&', s) debug('s',s) return s