Giter Site home page Giter Site logo

Comments (5)

hgiesel avatar hgiesel commented on July 18, 2024

Yep, most certainly. I'm currently in the process of updating add-ons for 2.1.41. I will have a look next week.

from anki__editor__apply__font_color__background_color__custom_class__custom_style.

ijgnd avatar ijgnd commented on July 18, 2024

that's great. thanks.

from anki__editor__apply__font_color__background_color__custom_class__custom_style.

hgiesel avatar hgiesel commented on July 18, 2024

I've updated it. You can apply spans again in the editor, and the styling will be visible.

Rangy will no longer work with the new editor code, so it will always use the "text" solution. The functionality of modifying the Editor CSS might be become a future Anki feature: ankitects/anki#1049.

Let me know if you find any more issues, @ijgnd.

from anki__editor__apply__font_color__background_color__custom_class__custom_style.

ijgnd avatar ijgnd commented on July 18, 2024

Thank you very much for updating to the new version.

In general it mostly works again. It doesn't work for me if the selection covers multiple paragraphs/divs. I tested in a new profile with only the custom styles add-on from addons.ankiweb with the binary 41beta6 for linux.

 

Example: When I have this in my field:

<div>one</div><div>two</div>

and I select the last letter of "one" and the first o "two" so that my selection is among two divs and I tell the add-on to apply a class I get the following source code:

<div>on</div><span class="bg_green"><div>e</div><div>t</div></span><div>wo</div>

no text is shown that has the styling from the class (because there's divs inside this span?)

from anki__editor__apply__font_color__background_color__custom_class__custom_style.

ijgnd avatar ijgnd commented on July 18, 2024

Another problem is that now line breaks are added.

 

Same example as before: When I have this in my field:

<div>one</div><div>two</div>

and I select the last letter of "one" and the first o "two" so that my selection is among two divs and I tell the add-on to apply a class with the old version/rangy it was rendered into two lines:

one
two

The modified source produced by the old version with rangy was <div>on<span class="bg_green">e</span></div><div><span class="bg_green">t</span>wo</div>.

Now with the most recent version from 2021-03-03 after applying the highlighting it's rendered into four lines like this:

on
e
t
wo

 

I guess that's the result of "Rangy will no longer work"/"Do not use rangy -> it's not compatible with the editor window"?

You still load rangy into the webview (I mean this). Does this mean that in theory it could be adjusted to work again and maybe someone in the future will adapt it? I'll have to learn more html/js before I could investigate this which won't happen before the end of the summer. Or is there really no chance that rangy (that hasn't been changed in the last six years) can work due to your recent changes to the anki editor which now uses more recent browser technologies?

from anki__editor__apply__font_color__background_color__custom_class__custom_style.

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.