Giter VIP home page Giter VIP logo

Comments (4)

zerodevx avatar zerodevx commented on June 14, 2024 1

Hi - thanks for highlighting this. I believe it's a bug because I didn't handle the edge case whereby an instance may be disconnected, then reconnected again, without being re-instantiated.

Internally, there are 2 pre-requisites before zero-md can begin its rendering op:

  1. Marked and Prism must be loaded; and
  2. The instance must be connected.

The waitForReady() function basically ensures that these 2 conditions are met.

I'll try to think of a better way to handle this and roll-out a bug fix soon. At the same time, I'll remove the (non-standard) JSON import so that you should be able to consume via the recommended way:

import ZeroMd from 'zero-md'

customElements.define('zero-md', ZeroMd)

render() {
  ...
}

Thanks again!

from zero-md.

zerodevx avatar zerodevx commented on June 14, 2024

Hi @jonmann20 - fixed it! Could you kindly help see if the issues are resolved? The latest version v2.1.0-rc.1 is in pre-release so if you could run this:

npm i -D zero-md@next

then consume using:

import ZeroMd from 'zero-md'

customElements.define('zero-md', ZeroMd)

render() {
  ...
}

and let me know if anything else crops up? 🙏

from zero-md.

jonmann20 avatar jonmann20 commented on June 14, 2024

Worked perfect, thanks for the quick response!

from zero-md.

zerodevx avatar zerodevx commented on June 14, 2024

Thanks for bringing this issue up! This should be fixed with the latest release. I'll mark this issue as closed for now - but do re-open this if it happens again. 🍻

from zero-md.

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.