diff --git a/plugin/vim.pl b/plugin/vim.pl index b43254e..1ccadb0 100644 --- a/plugin/vim.pl +++ b/plugin/vim.pl @@ -84,6 +84,8 @@ sub plugin_vim { $text =~ s/(\s|\n)*$//gs; $text .= "\n"; + $text = font2span($text); + chdir($pwd); # 캐쉬에 저장 @@ -98,4 +100,24 @@ sub plugin_vim { return $text; } +sub font2span { + my $html = shift; + + my @colors = $html =~ m/color="#([^"]+)"/g; + my %colorMap; + $colorMap{$_}++ for @colors; + @colors = keys %colorMap; + + my $style = "\n"; + $html = $style . $html; + $html =~ s/font color="#/span class="_/g; + $html =~ s/\/font/\/span/g; + return $html; +} + 1;