CustomJS into exported EPUB applies to epub code making the whole JS script not apply
Steps to reproduce
- Apply this js in the js editor: https://cdn.discordapp.com/attachments/1055525753325883403/1149714510836408502/script.js
- Go to the source Panda Machine translation, Into the creations
- Download the first 10 chaps
- export the EPUB applying the JS
- Test the EPUB with an android reader app like "Lithium", "Aldiko" and "Reasily"
Expected behavior
With JS applied this should be the result. It comes directly from the lnreader reader.
Actual behavior
I tested three apps that allow JS on epubs: "Lithium", "Aldiko" and "Reasily";
Lithium:
JS applied..
JS not applied (upon exporting)..
Aldiko:
JS applied..
Reasily:
JS applied..
You can notice if the js is applied by the presence of 11:00 in the screenshot. When the js is not applied it should be 11 am
LNReader version
1.1.16
Android version
Android 8 miui 8
Device
Huawei p8 lite 2017
Other details
Seems that the JS is not applied as well as lnreader reader.
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 1.1.17.
- [X] I will fill out all of the requested information in this form.
Without wasting time in testing i did it and these two pieces of code (together and indipendently) are the cause:
.replace(/(>(\s)?([\'’‘])?|[\!\?\…] ?|[\"”“]|[^\.]\. )([a-z])\B/g, (_,a,b,c,d)=>`${a}${d.toUpperCase()}`)
.replace(/([a-zA-Z])\.\+?([a-z])/g, "$1$2")
The problem with the whole thing is that i can't export JS code that applies properly on lnreader but doesnt outside of it. And if it doesnt, one has to check the JS code like i did and it is very annoying to fix and make sure it is applied properly on the export too.
This is the script file (inside the extracted epub) cleaned https://cdn.discordapp.com/attachments/1055525753325883403/1149713346577322045/script-clean.js
Hi, how did u apply the js editor
@ai4hub If you are asking how i applied it outside lnreader i simply imported the epub created by lnreader (js included) into the three apps i mentioned in the issue