PrismJS / PrismJS/prism

Soft wrap no working with no-line-numbers

Open
#3,419 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Information:

  • Prism version: 1.27.0
  • Plugins: line-numbers
  • Environment: Browser

Description
When using the line-numbers plug-in, soft wrap (white-space: pre-wrap;) only works with code blocks that have line numbers. No soft wrap for code blocks with no line numbers.

screenshot

Example

https://jsfiddle.net/efhu9ywa/

<style>
pre.line-numbers, pre.no-line-numbers
{
  white-space: pre-wrap;
}
</style>

<pre class="line-numbers"><code class="language-javascript">// I am a very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very long comment.</code></pre>

<pre class="no-line-numbers"><code class="language-javascript">// I am a very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very long comment.</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

Reproduce the difference in the linked JSFiddle with Prism 1.27.0, the line-numbers plugin, and white-space: pre-wrap. Inspect how the line-numbers plugin handles code blocks with and without line numbers; done means soft wrapping works in both examples and the behavior has a regression check.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.