Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Varbase FAQs 9.2.1 Minor update available for module varbase_faqs (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

Prism

156 sites Security covered
View on drupal.org

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.

Activity

Total releases
1
First release
Feb 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Dormant

Releases

Version Type Release date
2.2.3 Stable Feb 6, 2025