View Single Post
Old 09-07-2026, 10:59 AM   #12420
whiteowl
Enthusiast
whiteowl began at the beginning.
 
Posts: 48
Karma: 10
Join Date: Jan 2020
Device: none
It can work for a fully textual spoilers. But not for a spoiler which contain an image.

The legend_spoilers and details_spoilers create a box around the "spoiler". The issue of the box is that the calibre's Viewer is trying to show that box in one go, but fails (since the image is big). So it shows the top line of the box on one page, the image scaled to page on another page and bottom line of the box on the third page.

... wait. After thinking like that, I realize that my primary issue is that the "spoiler" box is actually split into three pages. So I did some playing with CSS. And resized the spoiler box, as well as an image inside it. My current settings are:

Code:
[base_xenforoforum]

legend_spoilers: true

[base_xenforoforum:epub]

add_to_output_css:
 .bbCodeSpoilerContainer { border: none; padding: 2px; width: 100%%; height: 90%%; }
 .bbCodeSpoilerContainer img { width: 100%%; height: 98%%; object-fit: contain; object-position: 1%% 0px; }
Now, the Viewer is able to scale an image inside the page, with some texts around it. So for posts where author did a one-sentence introduction and hid a big image in the spoiler - that whole post now fits one page in the Viewer.

As example, I am playing with https://forums.spacebattles.com/thre...ngeon.1169649/

I am, kind of, satisfied.
whiteowl is offline   Reply With Quote