PrismJS / PrismJS/prism

How to use line-number plugin with webpack

Open
#1,487 15 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I hava code link this. But it not show line number

const Prism = require('prismjs/components/prism-core.js');
require('prismjs/plugins/line-numbers/prism-line-numbers.js');
require('prismjs/themes/prism.css');
require('prismjs/components/prism-javascript');
const code = 'var a = 1;';

render() {
    <pre className="line-numbers" data-start="0">
        <code className="language-javascript" dangerouslySetInnerHTML={{ __html: code }} />
    </pre>
}

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 reproducing the supplied render snippet with webpack, the listed Prism line-numbers plugin, theme, and JavaScript component. Inspect prismjs/plugins/line-numbers/prism-line-numbers.js and the CSS import; done means the rendered code displays line numbers as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, webpack
Domain
build-system, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.