Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sentence parsing for {sentence} handlebar sometimes buggy. #1636

Open
jamesmaa opened this issue Dec 1, 2024 · 2 comments
Open

Sentence parsing for {sentence} handlebar sometimes buggy. #1636

jamesmaa opened this issue Dec 1, 2024 · 2 comments
Labels
kind/bug The issue or PR is regarding a bug

Comments

@jamesmaa
Copy link
Collaborator

jamesmaa commented Dec 1, 2024

Version: 24.11.23.0

  1. Go to yomitan.wiki
  2. Hover over "Powerful" and create an anki flashcard from it.
  3. Observe the sentence handlebar produces YomitanPowerful and versatile pop-up dictionary for language learning used by 50,000+ language learners.
image

It's not resolved by turning on "layout-aware scanning".

Similar problem: https://old.reddit.com/r/LearnJapanese/comments/1h1islv/daily_thread_simple_questions_comments_that_dont/lzdnfqn/

@jamesmaa jamesmaa added the kind/bug The issue or PR is regarding a bug label Dec 1, 2024
@v2lmmj04
Copy link

v2lmmj04 commented Jan 5, 2025

Yomitan version 24.12.18.1

A similar issue happens (sometimes) when using the Mokuro reader as well (Microsoft Edge).

  1. Go to https://reader.mokuro.app
  2. Upload your .cbz and .mokuro files from processing something with https://github.com/kha-white/mokuro
  3. Navigate into the uploaded volume
  4. Hover over a text box to trigger the text overlay
  5. Hover over / scan the desired text and create an Anki flashcard from it with Yomitan
  6. Observe that sometimes the sentence has the word "Volume" appended at the end of it

A random example from よふかしのうた volume 3, page 61:

image

"いかない" in the right bubble on the left panel results in the sentence on the card being:

そうはいかないだろナズナ Volume

The only "Volume" I could find on the page was this hidden Svelte div at a different level of the HTML:

<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0px; top: 0px; clip: rect(0px, 0px, 0px, 0px); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px;">Volume</div>

Doing the same workflow but on the left bubble of the same panel does not result in a "Volume" being appended at the end for some reason.

If you reload the page that directly links to the volume, the "svelte-announcer" div is empty (no "Volume" text) so the issue goes away. That div's text is only populated if you navigate to different pages (seems to be some internal Svelte state tracker going from "Mokuro" to "Manga" to "Volume" as you navigate those levels of the site), but when it is populated is when the issue can happen.

Enabling "layout-aware scanning" solves the problem in that "Volume" is no longer pulled in as part of the sentence for this example, but it no longer reliably concatenates the paragraph elements for the full sentence which is not desirable either. Like in this case, it results in:

そうはいかないだろ

Which is missing the last bit of text, "ナズナ", from the overall div:

<div class="textBox svelte-11qvai3" role="none" contenteditable="false" style="width: 63px; height: 102px; left: 364px; top: 455px; font-size: 21px; font-weight: 400; display: block; border: none; writing-mode: vertical-rl;">
    <p class="svelte-11qvai3">そうは</p>
    <p class="svelte-11qvai3">いかないだろ</p>
    <p class="svelte-11qvai3">ナズナ</p>
</div>

@YukiNagat0
Copy link

Same issue: #1648. Yomitan grabs near standing strings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug The issue or PR is regarding a bug
Projects
None yet
Development

No branches or pull requests

3 participants