Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Prism

Security covered Under active development 168 sites

This module adds code syntax highlighting to your Drupal content. It provides a filter to highlight custom code blocks and standard `<pre><code>` blocks, as well as a dedicated field type for entities that allows you to highlight code with language selection.

Prism.js is a lightweight, extensible syntax highlighter, built with modern web standards in mind. Use this module to add code syntax highlighting to your Drupal content.

The module provides a couple of options for adding syntax highlighting:

  • A "Highlight code using prism.js" filter that can be added to any text formatter. And will allow highlighting of both custom [prism][/prism] code blocks. And standard <pre><code class="langauge-*"> blocks. The filter plays nicely with other filters that create code blocks as well. For example Markdown's ``` code fences.
  • A "Prism.js" field that can be added to any fieldable entity. Each field instance consists of a textarea and the option to choose a language to use for syntax highlighting.

Requirements

This module requires both the prism.js and prism.css be downloaded and installed:

  • For Drupal 8+ the files should go in /libraries/prism/*
  • For Drupal 7 the files should go in sites/all/libraries/prism/*

The Prism library should be download from http://prismjs.com/download.html. You can customize the downloaded prism.js and prism.css files to your specific use-case using the tool available on the Prism.js website. For example if you want additional languages, or a different theme, choose the options in the download tool and then install the resulting prism.js and prism.css files in your Drupal project.

Drupal 9–11

Ask your assistant about Prism

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
5
Tracked since
Oct 2023
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 3
Maintenance
Dormant

Release Timeline

Releases

Version Type Core PHP Release date
2.2.3 Stable 9–11 Feb 6, 2025
2.2.2 Stable 9–11 Dec 16, 2024
2.2.1 Stable 9–11 Nov 21, 2024
2.2.0 Stable 9–11 Jul 8, 2024
2.1.0 Stable 8–10 Oct 31, 2023