Uploaded image for project: 'Maven Doxia'
  1. Maven Doxia
  2. DOXIA-616

Markdown: Properly expose the language specified in fenced code blocks

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8, 1.9, 1.9.1
    • 1.10
    • Module - Markdown
    • None

    Description

      Use Case

      Writers can specify the language used in a fenced code block (typically for syntax highlighting), as in the example below:

      ```java
      System.out.println("Beautiful\n");
      ```
      

      Currently, the Doxia module for Markdown does not expose this information ("java") in the produced HTML, so a Maven skin (or frontend renderer) cannot leverage it.

      Produced HTML:

      <div class="source"> <!-- No mention of Java :-( -->
      <pre>
      System.out.println("Beautiful\n");
      </pre>
      </div>
      

      Wanted result:

      <div class="source java"> <!-- :-) -->
      <pre>
      System.out.println("Beautiful\n");
      </pre>
      </div>
      

      Specification

      Un-comment this block:
      https://github.com/apache/maven-doxia/blob/c439714e8f4a9e86f9962ac6be9a0077ae9b4d30/doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/FlexmarkDoxiaNodeRenderer.java#L103

      This should do the trick.

      Attachments

        Issue Links

          Activity

            People

              michael-o Michael Osipov
              bertrandmartin Bertrand Martin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: