markdown-it / markdown-it-emoji

Emoji syntax plugin for markdown-it markdown parser
https://markdown-it.github.io/
MIT License
727 stars 167 forks source link

Window object #23

Closed mikenils closed 7 years ago

mikenils commented 7 years ago

Differences in browser. If you load the script directly into the page without using a package system, the module will add itself globally with the name markdownitEmoji. Init code will look a bit different in this case:

var md = window.markdownit().use(window.markdownitEmoji);

Is it really necessary to specify window object here? Works fine without it:

var md = markdownit().use(window.markdownitEmoji);
puzrin commented 7 years ago

Do as you wish.

mikenils commented 7 years ago

I just wanted to know what is better

puzrin commented 7 years ago

I don't know. This is generic programming question how to access global vars, not related to this repo.