Giter VIP home page Giter VIP logo

Comments (15)

Yukaru-san avatar Yukaru-san commented on May 30, 2024 1

Thanks for the detailed description. I'll look into it.
For the time being, you can double click results to copy them without line breaks.

from jotoba.

Yukaru-san avatar Yukaru-san commented on May 30, 2024 1

Oh yeah, you are right. I guess we can go with this approach then!

from jotoba.

marksg7 avatar marksg7 commented on May 30, 2024

Related bug -- trying to select the Kanji text with Yomichan doesn't work, it can only select one Kanji at once. I believe this is because of the HTML structure --

  • furigana-kanji-container
    • furigana = こと
    • first kanji = 言
  • furigana-kanji-container
    • furigana = ば
    • second kanji = 葉

Jisho handles it in this way:

  • furigana container
    • furigana for first kanji = こと
    • furigana for second kanji = ば
  • kanji = 言葉

This way is better since the Kanji are continuous in HTML.

from jotoba.

marksg7 avatar marksg7 commented on May 30, 2024

@Yukaru-san I can take this one on if it's not a priority for you, let me know if that's ok

from jotoba.

Yukaru-san avatar Yukaru-san commented on May 30, 2024

One of the reasons I decided to go with the current format is because there were some cases in which Jisho was kinda ugly (see the comparison below).
If you have an idea on how to improve this, you can give it a try!

image
[My son is busy studying for the examinations tomorrow.]

from jotoba.

marksg7 avatar marksg7 commented on May 30, 2024

Yeah, I'll give it a shot!

from jotoba.

marksg7 avatar marksg7 commented on May 30, 2024

Solved the Yomichan issue, but enabling ctrl-c copy while maintaining correct spacing for kanji is going to be very difficult or impossible. @StoneLabs @Yukaru-san thoughts on click-to-copy? Like clicking on the kanji will copy to clipboard?

from jotoba.

MoshiKoi avatar MoshiKoi commented on May 30, 2024

Here's a quick fiddle I made that I think solves the issue: https://jsfiddle.net/Lkdqsjrx/

Basically, it just abuses display: table to align the items properly. As a plus, if you want to enable copying the ruby text, you can do it without it interfering with copying the kanji.

from jotoba.

marksg7 avatar marksg7 commented on May 30, 2024

Here's a quick fiddle I made that I think solves the issue: https://jsfiddle.net/Lkdqsjrx/

Basically, it just abuses display: table to align the items properly. As a plus, if you want to enable copying the ruby text, you can do it without it interfering with copying the kanji.

Hmmm, I still get a tab between the kanji when I paste that into notepad. But I really like your use of display: table -- I was trying to fiddle more with flex boxes but couldn't resolve the copy-paste. I think there's definitely a way to work this.

from jotoba.

MoshiKoi avatar MoshiKoi commented on May 30, 2024

What about this one? https://jsfiddle.net/jfw89cdh/

This one uses flexboxes and uses display: content (from this stackoverflow answer) to get rid of the weirdness.

EDIT:

Actually, scratch literally everything. Just use actual ruby tags.

https://jsfiddle.net/fp0eg49x/

from jotoba.

Yukaru-san avatar Yukaru-san commented on May 30, 2024

Your <ruby> approach seems to be working quite nicely. It will still put spaces between segments though.
https://jsfiddle.net/wkjp3yc8/

from jotoba.

Yukaru-san avatar Yukaru-san commented on May 30, 2024

Solved the Yomichan issue, but enabling ctrl-c copy while maintaining correct spacing for kanji is going to be very difficult or impossible. @StoneLabs @Yukaru-san thoughts on click-to-copy? Like clicking on the kanji will copy to clipboard?

I'd be fine with click-to-copy if need be. It is currently implemented like that anyway (using a double click)

from jotoba.

MoshiKoi avatar MoshiKoi commented on May 30, 2024

Your <ruby> approach seems to be working quite nicely. It will still put spaces between segments though.
https://jsfiddle.net/wkjp3yc8/

You need to make sure that there are no spaces between the elements.

from jotoba.

marksg7 avatar marksg7 commented on May 30, 2024

Only thing is that the approach doesn't help with the Yomichan issue. sigh...

Edit: Solved! Just have to remove all the spaces. https://jsfiddle.net/dpbon94r/

from jotoba.

Yukaru-san avatar Yukaru-san commented on May 30, 2024

Solved with #14
Thanks for the contributions!

from jotoba.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.