Ki4en hljs and most other syntax highlighters on recognize code when it is inside <pre><code>.

    check CodeMirror out for textareas but i'm not sure if it supports CSS/LESS.

    I don't understand why textareas are discussed here, but if anyone wants to see an implementation of CodeMirror in Flarum, my Scratchpad extension uses it for the scratchpad panel of the admin dashboard.

    The editor isn't WYSIWYG, so no real time highlighting in the post composer is possible anyway.

      v1.1.3

      • Fixed compatibility with Flarum v1.0.1-beta.12 (Will not show default syntax theme).
      • Fixed multiple themes on a single page.
      • Other bug fixes and improvements.

      Updating

      Use Bazaar or update manually with composer:

      composer update therealsujitk/flarum-ext-hljs

      Note: Make sure to clear cache after the update.

      Note: Please disable and re-enable this extension after the update.

      8 days later
      5 months later

      v1.2.0

      • Updated dependencies and fixed security vulnerabilities.
      • Added theme: Brown Paper
      • Added theme: Codepen Embed
      • Added theme: Color Brewer
      • Added theme: Darcula
      • Added theme: Dark
      • Added theme: Docco
      • Added theme: Dracula

      Updating

      Use Bazaar or update manually with composer:

      composer update therealsujitk/flarum-ext-hljs

      Note: Please disable and re-enable this extension after the update.

      a month later

      v1.3.0

      • Updated highlight.js CDN to v10.2.0
      • Added theme: Github Gist
      • Added theme: Github
      • Added theme: Gml
      • Added theme: Googlecode
      • Added theme: Gradient Dark
      • Added theme: Gradient Light
      • Added theme: Grayscale
      • Added theme: Gruvbox Dark
      • Added theme: Gruvbox Light
      • Added theme: Hopscotch
      • Added theme: Hybrid
      • Added theme: Idea
      • Added theme: Ir Black
      • Added theme: Isbl Editor Dark
      • Added theme: Isbl Editor Light
      • Added theme: Kimbie Dark
      • Added theme: Kimbie Light
      • Added theme: Lightfair
      • Added theme: Lioshi
      • Added theme: Magula
      • Added theme: Mono Blue
      • Added theme: Monokai Sublime
      • Added theme: Monokai
      • Added theme: Night Owl
      • Added theme: Nnfx Dark
      • Added theme: Nnfx
      • Added theme: Nord
      • Added theme: Obsidian
      • Added theme: Ocean
      • Added theme: Paraiso Dark
      • Added theme: Paraiso Light
      • Added theme: Pojoaque
      • Added theme: Purebasic
      • Added theme: Qtcreator Dark
      • Added theme: Qtcreator Light
      • Added theme: Railscasts
      • Added theme: Rainbow
      • Added theme: Routeros
      • Added theme: School Book
      • Added theme: Shades Of Purple
      • Added theme: Solarized Dark
      • Added theme: Solarized Light
      • Added theme: Srcery
      • Added theme: Sunburst
      • Added theme: Tomorrow Night Blue
      • Added theme: Tomorrow Night Bright
      • Added theme: Tomorrow Night Eighties
      • Added theme: Tomorrow Night
      • Added theme: Tomorrow
      • Added theme: Vs
      • Added theme: Vs 2015
      • Added theme: Xcode
      • Added theme: Xt 256
      • Added theme: Zenburn

      Updating

      Use Bazaar or update manually with composer:

      composer update therealsujitk/flarum-ext-hljs

      Note: Please disable and re-enable this extension after the update.

        2 months later
        8 days later

        I'm a little busy at the moment so I won't be able to get to this anytime soon, I'll try working on this sometime during the mid of next month. @jordanjay29, could you add the Incompatible tag to this extension for the time being. Thanks!

          2 months later
          • [deleted]

          therealsujitk Rather cheekily, I'll admit, but I noticed that you've started updating your other extensions. Will this one be included ? 🙂

            v2.0.0

            • Added compatibility for v0.1.0-beta.15
            • Updated highlight.js CDN to v10.5.0
            • Added theme: Stackoverflow Dark
            • Added theme: Stackoverflow Light
            • Minor improvements and bug fixes

            Updating

            composer update therealsujitk/flarum-ext-hljs