PrismJS / PrismJS/prism

A way to “unload” plugins

Open
#459 11 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement plugins
Dominant language
JavaScript
Stars
13k
Forks
1.4k
Avg merge
15h 36m
Merged PRs (30d)
3

Description

I have a project using Prism to perform server-side rendering (similar to node). Simple rendering works well, but I’m facing problems with plugins. A plugin can be loaded simply by running the appropriate JavaScript file, but there seems to be no way to undo the process. Say I want to render two code blocks, first one with line numbers, and second one without—there is no way to do this unless I construct a new Prism instance for each one of them. Is it possible to add some kind of mechanism?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how Prism plugins are loaded and how separate Prism instances are created for server-side rendering. Compare the two rendering cases described in the issue and determine what unload behavior is needed for plugin-specific state. Done means plugins can be enabled for one render and absent from a later render without constructing a new Prism instance.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.