lnreader icon indicating copy to clipboard operation
lnreader copied to clipboard

[Flaw] Import – <image> not supported

Open Palloxin opened this issue 4 months ago • 0 comments

Steps to reproduce

Need an epub with an image encased inside an svg tag:

Image

Expected behavior

Either <image> is supported or converted to img.

You could simply run a regex to fix it before the app starts to process images:

.replace(/<image( [^]*?)xlink:href\b/g, '∆<img$1src')
.replace(/<svg [^>]+>(?:[^∆](?!\/svg))*∆(<img [^>]+>)[^]*?<\/svg>/g, '$1')

(the replacements simply delete all svg tags that encase a <image> inside it, the svg that dont have <image> inside them are untouched.)

Or, you could start support svg (remember to also allow the vast range of sub tags of svg to be allowed by the sanitizer)

Actual behavior

Image

LNReader version

2.0.0

Android version

a8

Device

huaw

Other details

epub example https://drive.google.com/file/d/176EjK_6JKFusBegkAsaB7BGvQwOyOL8M/view

Acknowledgements

  • [x] I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open or closed issue.
  • [x] I have written a short but informative title.
  • [x] If this is an issue with a source, I should be opening an issue in the sources repository.
  • [x] I have updated the app to version 2.0.0.
  • [x] I will fill out all of the requested information in this form.

Palloxin avatar Oct 25 '25 12:10 Palloxin