Skip to content

C syntax highlighting doesn't work #124

@thebaer

Description

@thebaer

Describe the bug

We're using a stripped-down version of the highlight.js library that doesn't include the needed code to do C syntax highlighting, and the right library isn't being dynamically loaded.

Notice that there is no c.min.js file in static/js/highlightjs/, so a WriteFreely post like this attempts to load it, but fails.

Solution

Instead of loading c.min.js when we encounter a code block labeled as c, we should load cpp.min.js. It lists c as an alias (among others, which we should probably do the same for):

aliases: ['c', 'cc', 'h', 'c++', 'h++', 'hpp', 'hh', 'hxx', 'cxx'],

(from cpp.js)

Application configuration

  • Single mode or Multi-user mode? either
  • Database? any
  • Open registration? any
  • Federation enabled? any

Version or last commit: v0.9.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpost renderingIssues related to the rendering and display of posts

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions