lnreader icon indicating copy to clipboard operation
lnreader copied to clipboard

text in between <> will be displayed as nothing

Open ShalolaAuthor opened this issue 1 year ago • 11 comments

Steps to reproduce

go to webview because i was flabbergasted why sometimes theres a word or two missing. turns out all the missing words are wrapped in <>.

Expected behavior

if the original written as <Nebula>. it should not be omitted.

<>. i think the parser recognize this as html tags so thats why it is being omitted?

Actual behavior

from certain <Nebula>.

displayed as: from certain .

LNReader version

1.1.19

Android version

Android 11

Device

Tab S6

Other details

No response

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.19.
  • [X] I will fill out all of the requested information in this form.

ShalolaAuthor avatar Mar 18 '24 00:03 ShalolaAuthor

frustrated because it also happens in github i will now revert this what im saying with this >< instead of this <>.

Nebula< is written. but it was omitted due to <>.

ShalolaAuthor avatar Mar 18 '24 00:03 ShalolaAuthor

i think you guys get the point right?

ShalolaAuthor avatar Mar 18 '24 00:03 ShalolaAuthor

Could you provide an example of a novel and chapter along with the source where this issue can be reproduced?

rajarsheechatterjee avatar Apr 14 '24 04:04 rajarsheechatterjee

Hello! I believe the OP is reading the same novel as me. Try "Omniscient Reader's Viewpoint", Chapter 388, the fourth paragraph:

[Nebula, , has opened a portal that will summon you].

Over here it showsup correctly: https://www.lightnovelworld.com/novel/omniscient-readers-viewpoint-265/chapter-388

Inshal240 avatar Apr 17 '24 19:04 Inshal240

Perhaps we can sanitize the <> here: https://github.com/LNReader/lnreader/blob/484c2b7e33fc4832b2d987c7f8a3dce74ef7b642/src/screens/reader/ReaderScreen.tsx#L298

Or there some special mark up to prevent it from reading it as html here: https://github.com/LNReader/lnreader/blob/484c2b7e33fc4832b2d987c7f8a3dce74ef7b642/src/screens/reader/ReaderScreen.tsx#L346

Honestly, I don't have experience with app development at all so I'm very hesitant to touch the code myself. However, this will definitely improve the reading experience of this app as key character names are within those <>. I had thought it was an error in the translation for the past 50 or more chapters and now I feel like an idiot :c

EDIT: Found this useful(?) question on stack overflow! https://stackoverflow.com/questions/2794137/sanitizing-user-input-before-adding-it-to-the-dom-in-javascript

Inshal240 avatar Apr 17 '24 19:04 Inshal240

Yes I also have this issue.

Example: <Nest Covered by Clouds> Dungeon becomes: Dungeon

1-minute-to-midnight avatar Apr 26 '24 11:04 1-minute-to-midnight

chapter = document.querySelector('chapter');
chapter.innerHTML = chapter.innerHTML
.replace(/<(\w+\b[\s\w’\']+|[A-Z][a-z]*)>/g, '&lt;$1&gt;');

Not a perfect solution but a lot of them should show with this.. Copy paste in custom js (Settings => Reader)

Palloxin avatar Apr 26 '24 11:04 Palloxin

It didn't work unfortunately (source: novelupdates)

1-minute-to-midnight avatar Apr 26 '24 11:04 1-minute-to-midnight

Say the novel name and chapter

Palloxin avatar Apr 26 '24 11:04 Palloxin

Acquired the Scam Rune in the Academy Chapter 205

1-minute-to-midnight avatar Apr 26 '24 11:04 1-minute-to-midnight

You’re right. Seems onky the edit in the code can fix it, I guess.

Palloxin avatar Apr 26 '24 12:04 Palloxin