Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shift_JIS非対応文字を追加した。 #30 が解決すれば、これらの追加は不要になります #69

Merged
merged 8 commits into from
May 9, 2014
7 changes: 6 additions & 1 deletion config/id_filter.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@
"◆WDB◆" : "<cstyle:ストッパ>#<cstyle:>",

"㈱" : "<3231>",
"\\(株\\)" : "<3231>"
"(株)" : "<3231>",
"✓" : "<ct:Regular><cf:Zapf Dingbats><2713><ct:><cf:>",
"✖" : "<ct:Regular><cf:Zapf Dingbats><2716><ct:><cf:>",
"\\" : "<005C><005C>",
"~" : "<007E>",
"~" : "<301C>"
}
}
2 changes: 1 addition & 1 deletion lib/Text/Md2Inao/Builder.pm
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,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 @@ -249,7 +249,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
34 changes: 32 additions & 2 deletions t/32_indesign_free_replacer.t
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ sub md2inao {
__END__
=== kbd
--- in md2inao
<kbd>A</kbd><kbd>Z</kbd>
<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 @@ -306,3 +306,33 @@ __END__
㈱(株)
--- expected
<ParaStyle:本文><3231><3231>

===
--- in md2inao
--- expected
<ParaStyle:本文><ct:Regular><cf:Zapf Dingbats><2713><ct:><cf:>

=== shiftjis
--- in md2inao
--- expected
<ParaStyle:本文><ct:Regular><cf:Zapf Dingbats><2716><ct:><cf:>

=== shiftjis
--- in md2inao
\
--- expected
<ParaStyle:本文><005C><005C>

=== shiftjis
--- in md2inao
~
--- expected
<ParaStyle:本文><007E>

=== fullwidth tilde to wave dash
--- in md2inao
--- expected
<ParaStyle:本文><301C>
8 changes: 4 additions & 4 deletions t/x_input.txt
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,13 @@

## キーボードフォント

<kbd>A</kbd><kbd>Z</kbd>
<kbd>A</kbd><kbd>Z</kbd>

<kbd>a</kbd><kbd>z</kbd>
<kbd>a</kbd><kbd>z</kbd>

<kbd>0</kbd><kbd>9</kbd>
<kbd>0</kbd><kbd>9</kbd>

<kbd>F1</kbd><kbd>F12</kbd>
<kbd>F1</kbd><kbd>F12</kbd>

<kbd>→</kbd><kbd>↓</kbd><kbd>↑</kbd><kbd>←</kbd>

Expand Down
8 changes: 4 additions & 4 deletions t/x_output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ function bar(b) {
◆←→◆
◆>=◆◆=>◆
■■キーボードフォント
A▲Z▲
a▲z▲
0▲9▲
F1▲F12▲
A▲Z▲
a▲z▲
0▲9▲
F1▲F12▲
→▲↓▲↑▲←▲
End▲
Alt▲
Expand Down