You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Removing line-numbers class from a code-input element or its ancestor doesn't visibly remove the line numbers #237
<!DOCTYPE html><html><body><!--For convenience, this demo uses files from JSDelivr CDN; for more privacy and security download and host them yourself.--><!--Prism+code-input--><scriptsrc="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-core.min.js" data-manual></script><!--Remove data-manual if also using Prism normally--><scriptsrc="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/plugins/autoloader/prism-autoloader.min.js"></script><linkrel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/themes/prism.min.css"></link><scriptsrc="https://cdn.jsdelivr.net/gh/WebCoder49/code-input@2.8/code-input.min.js"></script><linkrel="stylesheet" href="https://cdn.jsdelivr.net/gh/WebCoder49/code-input@2.8/code-input.min.css"><!--Import--><scriptsrc="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/plugins/line-numbers/prism-line-numbers.min.js"></script><linkrel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/plugins/line-numbers/prism-line-numbers.min.css"><linkrel="stylesheet" href="https://cdn.jsdelivr.net/gh/WebCoder49/code-input@2.8/plugins/prism-line-numbers.min.css"/><script>codeInput.registerTemplate("syntax-highlighted",newcodeInput.templates.Prism(Prism,[// CSS only - don't pass here]));</script><p>The lines are numbered! <buttononclick="document.querySelector('code-input').classList.toggle('line-numbers')">Toggle Line Numbers</button></p><code-inputclass="line-numbers" language="markdown"><textareadata-code-input-fallback># Hickory dickory dock
Hickory dickory dock.
The mouse ran up the clock.
The clock struck one,
The mouse ran down,
Hickory dickory dock.</textarea></code-input></body></html>
Click the "Toggle Line Numbers" button once.
Also test with the line-numbers class in a ancestor of the code-input element.
Expected result:
The left-padding of the code-input element decreases.
The line numbers disappear.
Actual result:
The left-padding of the code-input element decreases.
changed the title [-]Removing[/-][+]Removing line-numbers class from a code-input element or its ancestor doesn't visibly remove the line numbers[/+]on Sep 16, 2026
Activity
[-]Removing[/-][+]Removing line-numbers class from a code-input element or its ancestor doesn't visibly remove the line numbers[/+](TODO: Test) Fix no-line-numbers Prism case for wrap plugin; Fix #237:…
Add automated tests for prism-line-numbers including #237
Add automated tests for prism-line-numbers including #237