- πΊπΈ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>
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
Active
3.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
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>