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キーが連続すると、うまく変換されないの受け入れテスト #95

Closed
wants to merge 2 commits into from

Conversation

inao
Copy link
Collaborator

@inao inao commented May 26, 2014

さきほど @gfx さんの章で発生しました。

Shiftキーが連続する=変換後のInDesignテキストにバッククォートが2つ登場するなのですが、現状ですと以下のように、コマンドの扱いになってしまうようです。

<ParaStyle:本文><cFont:Key Snd Mother><CharStyle:コマンド><cFont:><cFont:Key Snd Mother><CharStyle:><cFont:>

@gfx
Copy link
Collaborator

gfx commented May 26, 2014

う〜ん、なるほど。これはけっこう厄介ですね…ちょっと面倒ですがkbdをconfigから分離して InDesign.pmで処理するのがいいか。

いつまでに直せばいいとかありますか?

@inao
Copy link
Collaborator Author

inao commented May 26, 2014

運用で乗り切れますので、いつまでとかはございません!

ふと思ったのですが、いまはid_filter.jsonのbefore_filterにキーボードフォントの変換を書いているのですが、それをafter_filterに移動させれば解決だったりしますか?
(いまローカルでmd2inaoを動かせないので検証できない)

@inao
Copy link
Collaborator Author

inao commented May 26, 2014

手元で動かせました。

普通に以下をafter_filterに移動させるだけだと、

<kbd>Shift</kbd><kbd>Shift</kbd>

次のようになりダメですね。

<ParaStyle:本文><cFont:KeyMother>Shift<cFont:><cFont:KeyMother>Shift<cFont:>

おそらく、id_filter.json以前の、md2inao本体の<kbd></kbd>処理で置換されており、after_filterでは何も行われていないっぽいです。

そこでafter_filterに次のように変換済みテキストをさらに変換する設定を書いたら、うまくいきました。

"<cFont:KeyMother>Shift<cFont:>" : "<cFont:Key Snd Mother>`<cFont:>",

バッドノウハウですけど、これでいきましょうか。

あるいは、「md2inao本体の<kbd></kbd>処理が実行されるのは、<kbd></kbd>内がa-zA-Z0-9の1文字のときのみ」という制約を課していただければ、after_filterに普通に書くだけで処理できるようになるかもです(たぶん…)。

@inao inao added the high label May 31, 2014
@inao inao changed the title Shiftキーが連続すると、うまく変換されない Shiftキーが連続すると、うまく変換されないのテスト Dec 19, 2014
@inao inao changed the title Shiftキーが連続すると、うまく変換されないのテスト Shiftキーが連続すると、うまく変換されないの受け入れテスト Dec 19, 2014
以下のバッドノウハウで回避する

#95 (comment)
@inao
Copy link
Collaborator Author

inao commented Apr 3, 2015

#103 によりこの問題は発生しなくなりますので、クローズします。

@inao inao closed this Apr 3, 2015
@inao inao deleted the shift-test branch April 3, 2015 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants