alexadam / alexadam/save-as-ebook

Unexpected behavior on custom stylesheet.

オープン
#57 コメント 1 件 リアクション 0 件 担当者 1 名 @alexadam が担当を希望しています GitHub で見る
bug
主要言語
JavaScript
スター
1.1k
フォーク
74
PR マージ指標
30日以内にマージされた PR はありません

説明

The attributes writing-mode and -epub-writing-mode are filtered out by extractHtml.js in supportedCss. Adding them to the array lets them through to the combined css. However, there is still an unexpected behavior.

Adding the following css snippet to the custom styles:
`html {
-epub-writing-mode: vertical-rl;
writing-mode: vertical-rl;
}
`
The resulting css in the epub is:
`.vj0 {background-color:rgba(0, 0, 0, 0);border:0px none rgb(0, 0, 0);color:rgb(0, 0, 0);font:16px / 25.6px "Times New Roman";line-height:25.6px;list-style:outside none disc;padding:0px;text-align:start;writing-mode:vertical-rl;} .wY1 {background-color:rgba(0, 0, 0, 0);border:0px none rgb(0, 0, 0);color:rgb(0, 0, 0);font:700 32px / 51.2px "Times New Roman";line-height:51.2px;list-style:outside none disc;padding:0px;text-align:start;writing-mode:vertical-rl;} .zV2 {background-color:rgba(0, 0, 0, 0);border:0px none rgb(0, 0, 0);color:rgb(0, 0, 0);font:700 24px / 38.4px "Times New Roman";line-height:38.4px;list-style:outside none disc;padding:0px;text-align:start;writing-mode:vertical-rl;} .mv349 {background-color:rgba(0, 0, 0, 0);border:0px none rgb(0, 0, 0);color:rgb(0, 0, 0);font:700 20px / 25.6px "Times New Roman";line-height:25.6px;list-style:outside none disc;padding:0px;text-align:start;writing-mode:vertical-rl;} .RM354 {background-color:rgba(0, 0, 0, 0);border:0px none rgb(0, 0, 0);color:rgb(0, 0, 0);font:700 18px / 25.6px "Times New Roman";line-height:25.6px;list-style:outside none disc;padding:0px;text-align:start;writing-mode:vertical-rl;} .Jk357 {background-color:rgba(0, 0, 0, 0);border:0px none rgb(0, 0, 0);color:rgb(0, 0, 0);font:16px / 16px "Times New Roman";line-height:16px;list-style:outside none disc;padding:0px;text-align:start;writing-mode:vertical-rl;} .lL360 {background-color:rgba(0, 0, 0, 0);border:0px none rgb(0, 0, 0);color:rgb(0, 0, 0);font:8px / 4px "Times New Roman";line-height:4px;list-style:outside none disc;padding:0px;text-align:start;writing-mode:vertical-rl;} .ow8104 {background-color:rgba(0, 0, 0, 0);border:0px none rgb(0, 0, 0);color:rgb(0, 0, 0);font:13.3333px / 25.6px "Times New Roman";line-height:25.6px;list-style:outside none disc;padding:0px;text-align:start;writing-mode:vertical-rl;} .xU24984 {background-color:rgba(0, 0, 0, 0);border:1px inset rgb(0, 0, 0);color:rgb(0, 0, 0);font:16px / 25.6px "Times New Roman";line-height:25.6px;list-style:outside none disc;padding:0px;text-align:start;writing-mode:vertical-rl;} .Hj24998 {background-color:rgba(0, 0, 0, 0);border:0px none rgb(0, 0, 238);color:rgb(0, 0, 238);font:16px / 25.6px "Times New Roman";line-height:25.6px;list-style:outside none disc;padding:0px;text-align:start;writing-mode:vertical-rl;} .Zr25006 {background-color:rgba(0, 0, 0, 0);border:0px none rgb(0, 0, 0);color:rgb(0, 0, 0);font:16px / 25.6px "Times New Roman";line-height:25.6px;list-style:outside none disc;padding:40px 0px 0px;text-align:start;writing-mode:vertical-rl;} .QM25007 {background-color:rgba(0, 0, 0, 0);border:0px none rgb(0, 0, 0);color:rgb(0, 0, 0);font:16px / 25.6px "Times New Roman";line-height:25.6px;list-style:outside none disc;padding:0px;text-align:left;writing-mode:vertical-rl;} `

The -epub-writing-mode somehow was still filtered out. This renders the whole book wrong, somehow collapsing a 56 chapters book into a 4 pages book.
Manually adding back the -epub-writing-mode snippet to the top of that generated css fixes the book rendering.
`html {
-epub-writing-mode: vertical-rl;
}
...
`

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。