- Timestamp:
- 09/28/08 11:42:53 (2 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
platform/movabletype/plugins/TextHatena/mt-text-hatena.pl
- Property svn:executable deleted
r11887 r20102 32 32 33 33 sub _rewrite_tag { 34 my ($tag, $text) = @_; 34 my ($tag, $text, $attr) = @_; 35 36 if ($attr ~= /\sdatetime\s*=/) { 37 return sprintf('<%s%s>%s</%s>',$tag, $attr, $text, $tag); 38 } 35 39 36 40 my $dt = DateTime->now->set_time_zone('local'); 37 41 my $dtstr = DateTime::Format::W3CDTF->format_datetime($dt); 38 42 39 return sprintf('<%s datetime="%s">%s</%s>',$tag, $dtstr, $text, $tag);43 return sprintf('<%s%s datetime="%s">%s</%s>',$tag, $attr, $dtstr, $text, $tag); 40 44 } 41 45 … … 45 49 for my $key (qw/text text_more/) { 46 50 my $text = $entry_page->$key; 47 $text =~ s{<( (?:ins|del))>(.*?)</\1>}{ &_rewrite_tag($1, $2); }egsx;51 $text =~ s{<(ins|del)(\s[^>]+)?>(.*?)</\1\s*>}{ &_rewrite_tag($1, $3, $2); }gsex; #SEX! 48 52 $entry_page->$key($text); 49 53 }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)