You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2026/10/20 01:28:02 UTC

[jira] [Closed] (GROOVY-11950) Add -preLanguage Groovydoc option to syntax-highlight legacy
 blocks

     [ https://issues.apache.org/jira/browse/GROOVY-11950?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul King closed GROOVY-11950.
------------------------------

> Add -preLanguage Groovydoc option to syntax-highlight legacy <pre> blocks
> -------------------------------------------------------------------------
>
>                 Key: GROOVY-11950
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11950
>             Project: Groovy
>          Issue Type: New Feature
>          Components: groovy-groovydoc
>            Reporter: Paul King
>            Assignee: Paul King
>            Priority: Major
>             Fix For: 6.0.0-alpha-1
>
>
> Doc comments frequently use plain {{<pre>...</pre>}} blocks for code examples. Prism's highlighter only walks {{<code>}} descendants of language-classed elements, so these legacy blocks are skipped even when {{-syntaxHighlighter=prism}} is on.
> Introduce a new {{-preLanguage}} option (CLI) / {{preLanguage}} attribute (Ant task) that post-processes the generated HTML:
> - A bare {{<pre>body</pre>}} is rewritten to {{<pre class="language-xxx"><code>body</code></pre>}}, using the configured language id.
> - A {{<pre class="language-xxx">}} that lacks an inner {{<code>}} has its body wrapped in {{<code>}}.
> - {{<pre>}} tags with any existing attribute (e.g. {{class="groovyTestCase"}}, author-chosen {{class="language-sql"}}, {{id="..."}}) are left untouched.
> Opt-in; no effect when unset. Complements {{-syntaxHighlighter}} rather than replacing it.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)