Add syntax highlighting class details to Drupal.org filter tips

Created on 29 September 2017, over 6 years ago
Updated 25 June 2024, 4 days ago

Follow-up of #2629046: Add syntax highlighting to Drupal.org β†’ .

There should be some information about syntax highlighting in <code> Tag on https://www.drupal.org/filter/tips β†’ or alternatively the editors code button could open a popup (similar to the link popup) where to choose a highlighting class.

Currently it's unclear to me how to use highlighting for everything else than php. joelpittet suggested β†’ :

Need class="language-XXXXX"

In simple cases that works, for example the code

<code class="language-diff">
- It doesn't work
+ It works
</code>

Results in

- It doesn't work
+ It works

✨ Feature request
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany osopolar πŸ‡©πŸ‡ͺ GER 🌐

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States kentr

    FWIW, the filter currently accepts <pre><code class="language-XXXX">....

    For example, this will result in a block of highlighted yaml:

    <pre>
      <code class="language-yaml">
        foo: 'bar'
        baz:
          - a
          - b
      </code>
    </pre>
    
    
Production build 0.69.0 2024