Skip to content

Commit

Permalink
fix char convertion for sjis (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
gfx committed Mar 4, 2014
1 parent 7d99489 commit af2da17
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions config/id_filter.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@
"◆WDB◆" : "<cstyle:ストッパ>#<cstyle:>",

"㈱" : "<3231>",
"\\(株\\)" : "<3231>",
"(株)" : "<3231>",
"✓" : "<ct:Regular><cf:Zapf Dingbats><2713><ct:><cf:>",
"✖" : "<ct:Regular><cf:Zapf Dingbats><2716><ct:><cf:>",
"\" : "<005C><005C>",
"\\" : "<005C><005C>",
"~" : "<007E>",
"~" : ""
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Text/Md2Inao/Builder.pm
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ sub after_filter {
$out =~ s/◆gt◆/>/g;
if (my $config = $self->after_filter_config) {
for my $k (keys %$config) {
$out =~ s/$k/$config->{$k}/eg;
$out =~ s/\Q$k/$config->{$k}/eg;
}
}
return $out;
Expand Down
2 changes: 1 addition & 1 deletion t/30_indesign_basic_syntax.t
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ __END__
<ParaStyle:リスト>function hoge() {
<ParaStyle:リスト> alert(foo); … <CharStyle:丸文字><2460><CharStyle:>
<ParaStyle:リスト> alert(bar); … <CharStyle:丸文字><2461><CharStyle:>
<ParaStyle:リスト> alert(c1); // \でエスケープできます
<ParaStyle:リスト> alert(c1); // <005C><005C>でエスケープできます
<ParaStyle:リスト>}
Expand Down
8 changes: 4 additions & 4 deletions t/32_indesign_free_replacer.t
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ __END__
--- in md2inao
<kbd>A</kbd>~<kbd>Z</kbd>
--- expected
<ParaStyle:本文><cFont:KeyMother>A<cFont:><cFont:KeyMother>Z<cFont:>
<ParaStyle:本文><cFont:KeyMother>A<cFont:><cFont:KeyMother>Z<cFont:>
=== right arrow
--- in md2inao
Expand Down Expand Up @@ -300,13 +300,13 @@ __END__
--- expected
<ParaStyle:本文><CharStyle:赤字>□<CharStyle:>
===
===
--- in md2inao
㈱(株)
--- expected
<ParaStyle:本文><3231><3231>
===
===
--- in md2inao
--- expected
Expand All @@ -320,7 +320,7 @@ __END__
=== shiftjis
--- in md2inao
\
\\
--- expected
<ParaStyle:本文><005C><005C>
Expand Down

0 comments on commit af2da17

Please sign in to comment.