Giter Site home page Giter Site logo

Comments (4)

thibaudcolas avatar thibaudcolas commented on May 27, 2024

Hi @mjjo53, thanks for reporting this. Do you have some thoughts on what a fix would look like, or are you interested in contributing one? I’m interested in helping getting this working, but it will go much faster getting a fix done if you can drive this.

from draftjs_exporter.

thibaudcolas avatar thibaudcolas commented on May 27, 2024

I just realised that I actually also ran into this issue on one of my projects, and solved it by manually re-setting the engine whenever calling render:

https://github.com/thibaudcolas/draftail-playground/blob/81ad38dd24bbc67a00ba93a751d8f4f8946d4268/markdown.py#L20-L22

def render_markdown(content_state):
    DOM.use(ENGINE)
    return exporter.render(content_state)

Does that seem like a viable solution to you? I think I might add this directly in exporter.render if so, so we can solve this without having to change how this code is structured too much.

from draftjs_exporter.

bindung avatar bindung commented on May 27, 2024

@thibaudcolas
Your example code is not thread safe.

from draftjs_exporter.

thibaudcolas avatar thibaudcolas commented on May 27, 2024

@bindung yes, as far as I know the whole library isn’t thread-safe, as @mjjo53 initially reported. The code above only helps in a single-threaded environment. Do you have any suggestions for how to fix this properly, or further diagnostic of the problem?

from draftjs_exporter.

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.