Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

9
  • 6
    One of the very important factors they're also going to look at is overall size. How big is the script in comparison to Prettify?
    – animuson StaffMod
    Commented Oct 23, 2014 at 0:14
  • @animuson In 2011, it was a few KBs smaller than Prettify. Not sure if that's still accurate, though.
    – hichris123
    Commented Oct 23, 2014 at 0:28
  • @animuson I count 14,941 bytes for highlight.js, I couldn't figure out Prettify.
    – Braiam
    Commented Oct 23, 2014 at 0:29
  • The size depends on the languages included in the package. The "common" set of 22 languages is ~35K, the full one may be as big as ~300K but nobody needs that.
    – isagalaev
    Commented Oct 23, 2014 at 1:30
  • Here's the numbers. With all the languages listed on meta.stackexchange.com/questions/184108/… highlight.js is 46K, Prettify is 29K (non-gzipped).
    – isagalaev
    Commented Oct 23, 2014 at 1:41
  • Hmm… Actually, I should say that this size comparison is probably wrong as I looked more closely at the prettify.js linked on StackOverflow and I highly doubt it supports all those languages listed. Some of them may be supported simply as "looks close enough".
    – isagalaev
    Commented Oct 23, 2014 at 3:58
  • 2
    How is it doing speed-wise? Can you offer a real-time preview? Commented Oct 23, 2014 at 16:31
  • @JanDvorak there are two demo links within my question (highlightjs.org/static/stackoverflow/so1.html, highlightjs.org/static/stackoverflow/so2.html), they are real-time highlighting with language detection. In normal cases like these the result is pretty much instantaneous.
    – isagalaev
    Commented Oct 23, 2014 at 17:28
  • 1
    Here's Stack Overflow's response from 2016: meta.stackexchange.com/a/279361/285250 Commented Jun 16, 2020 at 1:08