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

request: Better compatibility with renshuu.org #67

Closed
MarcusAseth opened this issue Dec 5, 2018 · 4 comments
Closed

request: Better compatibility with renshuu.org #67

MarcusAseth opened this issue Dec 5, 2018 · 4 comments
Milestone

Comments

@MarcusAseth
Copy link

renshuu.org is a SRS quizzing site by many thought as superior to Anki.

On Chrome browser using rikaikun or yomichan they are capable of properly highlight words on renshuu, as shown in the image below:
immagine

On Firefox using rikaichamp however, words aren't properly highlighted, image below:
immagine

All the kanji are analized separately. Would be possible to make rikaichamp work as well as rikaikun and yomichan when used on renshuu.org?

@birtles
Copy link
Member

birtles commented Dec 5, 2018

It looks like this site uses content like the following:

<div class="fleft" style="padding-left: ">
  <ruby class="k10">
    <rb>
      <span class="klook"></span>
    </rb>
    <rt></rt>
  </ruby>
  <ruby class="k10">
    <rb></rb>
    <rt>&nbsp;</rt>
  </ruby>
  <div class="ib little" style="vertical-align: bottom"><svg>...</svg></div>
</div>

But it seems like the site is doing its own faux-ruby layout with rules like:

/* ルビベース */
ruby > rb, ruby > rbc
{
    display: table-row-group;
    line-height: 120%; /* 120% */
}

Which means that rikaichamp fails to detect the <rb> element as a inline element when it does this check:

const isInline = (element: Element | null) =>
  element &&
  ['inline', 'ruby', 'ruby-base', 'ruby-text'].includes(
    getComputedStyle(element).display!
);

We might need to add specific faux-ruby handling that treats <rb> / <ruby> etc. as inline elements regardless of their computed style.

@birtles birtles added this to the 0.0.27 milestone Dec 5, 2018
@birtles
Copy link
Member

birtles commented Dec 5, 2018

Thanks for the report by the way. Very helpful.

@birtles
Copy link
Member

birtles commented Dec 28, 2018

I've tested this and the next version of Rikaichamp, when released, should work correctly with renshuu.org. Thanks for the report!

@MarcusAseth
Copy link
Author

Awesome, thanks! :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants