alexadam/save-as-ebook

Ruby rp tags dropped by extractCss() of extractHtml.js

Opened this issue · 0 comments

It seems that the code if (!$pre.is(':visible')) { $pre.replaceWith(''); } would drop invisible tag 'rp' in recent versions of modern browsers. However, this method may cause some ePub readers which are not supported ruby (e.g. SumatraPDF) would missing parenthesis.

Taking SumatraPDF as ePub reader as an example, when ruby rp tags are existed would look like

ruby base(ruby text)

Meanwhile, the ePub file packed by save-as-ebook would look like

ruby base ruby text

I think it is better not drop the rp tags, even if they are invisible in ruby-supported browsers.
My ugly workaround code is if( pre.tagName.toLowerCase() === 'rp' ) { return; } , it just simply exclude rp tags when drop invisible tags.