progit-ja / progit

Forked repo of progit/progit for ja. Used for publishing ebook contents only.
http://progit.org
34 stars 5 forks source link

サーカムフレックス記号の扱い #6

Closed southly closed 10 years ago

southly commented 10 years ago

RDiscount はサーカムフレックス記号 ^ を上付き文字に処理するようですね。 そのため「Windowsにインストール」のところのサーカムフレックス記号が上付き文字になってしまいます。

^^ と書けばとりあえず防ぐことができますが、 そもそも処理させないように makeebooks を以下のようにした方がいいかもしれません。

diff --git a/makeebooks b/makeebooks
index 5d2f308..d1b2219 100755
--- a/makeebooks
+++ b/makeebooks
@@ -91,7 +91,7 @@ ARGV.each do |lang|
       puts "processing #{input}"
       content = File.read(input)
       content.gsub!(/Insert\s18333fig\d+\.png\s*\n.*?(\d{1,2})-(\d{1,2})\. (.*)/, '![\1.\2 \3](figures/\1.\2.png "\1.\2 \3")')
-      book_content << RDiscount.new(content).to_html
+      book_content << RDiscount.new(content, :strict).to_html
     end
     book_content << "</body></html>"
harupong commented 10 years ago

Issue とパッチ、ありがとうございます!この問題、少し前に気づいて「カッコ悪いな...」と思っておりました。

bb3493d で12/9にリリースしたバージョンでは修正されたかと思っていましたが、いまだ上付け文字になってますでしょうか?手元の Kindle.app for iOS と Kindle Paperwhite では上付け表示を確認できませんでした。

southly commented 10 years ago

おっしゃる通り、配布版は大丈夫ですね。自分で変換したものと勘違いしていたようです。 bb3493d6df9c6fbc6b1a28056b93f55049c59674 は HTML を修正してあるのでしょうか。 でしたら、この件は upstream に pull request を送ってみようと思います。

harupong commented 10 years ago

bb3493d の HTML は makeebooks で生成された未編集のデータですね。

以前のバージョンでは apt パッケージの ruby-rdiscount を使って生成、bb3493d は rubygems.org 上の最新版を使って生成した記憶があります。前者は 1.6系、後者は2.1系だったので、その差異かもしれません。

southly commented 10 years ago

なるほど。ruby-rdiscount のバージョンとはうっかりしていました。 こちらの環境が問題だったということで納得いたしました。 ありがとうございました。