highlightjs-line-numbers.js
highlightjs-line-numbers.js copied to clipboard
`TypeError: Cannot read properties of undefined (reading 'trim')`
Describe the bug
JS console error from highlightjs-line-numbers.min.js
.
To Reproduce Steps to reproduce the behavior:
...
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/vs2015.min.css" integrity="sha512-mtXspRdOWHCYp+f4c7CkWGYPPRAhq9X+xCvJMUBVAb6pqA4U8pxhT3RWT3LP3bKbiolYL2CkL1bSKZZO4eeTew==" crossorigin="anonymous" referrerpolicy="no-referrer">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlightjs-line-numbers.js/2.8.0/highlightjs-line-numbers.min.js" integrity="sha512-axd5V66bnXpNVQzm1c7u1M614TVRXXtouyWCE+eMYl8ALK8ePJEs96Xtx7VVrPBc0UraCn63U1+ARFI3ofW+aA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
...
Have this in your HTML, use highlightjs (and line-numbers). Prints this to console.
highlightjs-line-numbers.min.js:1
Uncaught TypeError: Cannot read properties of undefined (reading 'trim')
at highlightjs-line-numbers.min.js:1:1620
at f (highlightjs-line-numbers.min.js:1:1932)
at highlightjs-line-numbers.min.js:1:1004
Expected behavior No errors.
Desktop (please complete the following information):
- OS: Ubuntu
- Browser [e.g. chrome, safari]: Edge
- Version [e.g. 22]: 125.0.2535.79