[Python-checkins] CVS: python/dist/src/Doc/perl python.perl,1.97,1.98

Fred L. Drake fdrake@users.sourceforge.net
Wed, 11 Apr 2001 21:03:24 -0700


Update of /cvsroot/python/python/dist/src/Doc/perl
In directory usw-pr-cvs1:/tmp/cvs-serv13623

Modified Files:
	python.perl 
Log Message:

When forming the <A> tag for a \seepep or \seerfc, make sure we strip
HTML markup from the string used as the title in the TITLE attribute.

This fixes formatting in the "What's New in Python 2.1" document.


Index: python.perl
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/perl/python.perl,v
retrieving revision 1.97
retrieving revision 1.98
diff -C2 -r1.97 -r1.98
*** python.perl	2001/04/10 17:13:39	1.97
--- python.perl	2001/04/12 04:03:22	1.98
***************
*** 1498,1501 ****
--- 1498,1509 ----
  }
  
+ sub strip_html_markup($){
+     my $str = @_[0];
+     my $s = "$str";
+     $s =~ s/<[a-zA-Z0-9]+(\s+[a-zA-Z0-9]+(\s*=\s*(\'[^\']*\'|\"[^\"]*\"|[a-zA-Z0-9]+))?)*\s*>//g;
+     $s =~ s/<\/[a-zA-Z0-9]+>//g;
+     return $s;
+ }
+ 
  sub handle_rfclike_reference{
      local($_, $what, $format) = @_;
***************
*** 1505,1511 ****
      my $url = get_rfc_url($rfcnum, $format);
      my $icon = get_link_icon($url);
      return '<dl compact class="seerfc">'
        . "\n    <dt><a href=\"$url\""
!       . "\n        title=\"$title\""
        . "\n        >$what $rfcnum, <em>$title</em>$icon</a>"
        . "\n    <dd>$text\n  </dl>"
--- 1513,1520 ----
      my $url = get_rfc_url($rfcnum, $format);
      my $icon = get_link_icon($url);
+     my $attrtitle = strip_html_markup($title);
      return '<dl compact class="seerfc">'
        . "\n    <dt><a href=\"$url\""
!       . "\n        title=\"$attrtitle\""
        . "\n        >$what $rfcnum, <em>$title</em>$icon</a>"
        . "\n    <dd>$text\n  </dl>"