question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Prism being contained in CodeFlask removes plugin abilities

See original GitHub issue

I use the Custom Class plugin to namespace the Prism classes, since some of them conflict with my own CSS.

Before 1.0, CodeFlask used the Prism that I provided, meaning everything worked just fine. Now, however, CodeFlask uses its own version of Prism, meaning that I no longer can use the plugin, which breaks styling.

I see no way to interface with CodeFlask’s version of Prism outside of the language functions. (I see Prism is in the global namespace, confusing me even more as to why it’s included with CodeFlask) I would love to see a way to disable CodeFlask’s version of Prism and be able to use my own, similar to how it was before 1.0. I can only see more issues in the future because of Prism being included in CodeFlask instead of CodeFlask depending on it.


This may change depending on the load order, but I have to load Prism before CodeFlask so I can add languages to it (#65 related). I suppose that I could maybe load Prism before CodeFlask, change its name to Prism2, then set CodeFlask’s Prism equal to Prism2, but that seems like a gigantic hack.

Either way, I shouldn’t have to (and by extension shouldn’t have to force my users to) load Prism twice 😢

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ascclemenscommented, May 7, 2018

Maybe I like one sugar and no cream and @kashike likes two and cream. When the coffee comes with a pre-determined amount of cream and sugar, though, we don’t get a choice. Maybe I don’t want the extra calories or might decide I want cream sometimes but not other times. I don’t really get a choice when everything is bundled and injected for me.

It makes everything marginally easier for the developer throwing together a quick project (one script element instead of two scripts and one link), but it makes it much less flexible and adds a lot of frustration for people using it for big projects.

Edit: That being said, if we can get rid of inline styles and resolve this issue, I’ll be happy either way ¯\_(ツ)_/¯

1reaction
kashikecommented, May 7, 2018

The reason why I’d like to keep Prism as a CodeFlask dependency (inside CodeFlask) is the same reason why the CSS is now embedded into CodeFlask: It’s way easier to use a library that simply runs without having to add gazillions of other things around it.

And it’s another reason that makes people not want to use your library.

If I go to a coffee shop and order a plain coffee I expect a plain coffee, not a coffee with cream and sugar.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prism being contained in CodeFlask removes plugin abilities
Prism being contained in CodeFlask removes plugin abilities. ... I use the Custom Class plugin to namespace the Prism classes, since some of...
Read more >
{add,update}Language aren't static · Issue #65
load prism.js after codeflask so it doesn't get overwritten for (var ... Prism being contained in CodeFlask removes plugin abilities #66.
Read more >
CodeFlask -- A micro code-editor for awesome web pages.
If all you want is to highlight code on your page, you should use the plugin that gave origin to CodeFlask and that...
Read more >
CodeFlask: A Micro Code-editor for Awesome Web Pages
Getting the current code from editor ... import Prism from 'prismjs'; import CodeFlask from 'codeflask'; const flask = new CodeFlask('#my-selector', ...
Read more >
Top 5: Best code editor plugins written in Javascript
See our collection from 5 of the best code editors plugins for your web ... In order to use CodeFlask.js you need also...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found