Prism JS line number misaligned in Chrome

277 Views Asked by At

I'm using Prism Js to highlight code, but line numbers are not aligend properly in Chrome in some cases. However it works perfectly in Firefox. Here's the screenshot.

enter image description here

Can anybody help?

1

There are 1 best solutions below

0
stats con chris On

You solve this using external CDN. Try

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.25.0/plugins/line-numbers/prism-line-numbers.min.css"/> 

and

<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.25.0/plugins/line-numbers/prism-line-numbers.min.js"></script>

on top of your default prism.