GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [core] CPD Markdown format: Add syntax highlighting · Issue #6308 · pmd/pmd

[core] CPD Markdown format: Add syntax highlighting #6308

New issue
Copy link
New issue
Copy link
Closed
#6605
Closed
[core] CPD Markdown format: Add syntax highlighting#6308
#6605
Copy link
Labels
an:enhancementAn improvement on existing features / rulesin:cpdAffects the copy-paste detector
Milestone
7.25.0

Description

@gilprime
gilprime
opened on Dec 3, 2025
Issue body actions

Is your feature request related to a problem? Please describe.
I'm new to this project and i'm little bit frustrated when i'm generating markdown report using CPD, markdown report do not precise the language before the code block and the code is displayed as text, no syntax coloring... :/
I'm currently analysing a cpp project.

Describe the solution you'd like
As --language option is set, set the highlightLanguage to the right one

Describe alternatives you've considered
Once markdown is generated, add cpp after ``` in the .md file (odd ones, for the starting block).

Additional context
loofing in the pmd-core/src/main/java/net/sourceforge/pmd/cpd/MarkdownRenderer.java shows that if the file ends with .java or .jav, then the highlightLanguage is set, but other languages are not managed

Activity

  1. gilprime
    added
    an:enhancementAn improvement on existing features / rules
    on Dec 3, 2025
  2. gilprime commented on Dec 4, 2025

    @gilprime
    gilprime
    on Dec 4, 2025
    Author
    More actions

    for instance with awk you can add the language on odd ``` in md file

    awk '/^```$/ { count++; if (count % 2 == 1) print "```cpp"; else print; next } 1' my-cpd-report.md > temp && mv temp my-cpd-report.md

  3. adangel
    changed the title [-]Add highlight on markdown format if language is provided[/-] [+][core] CPD Markdown format: Add syntax highlighting[/+] on Jan 16, 2026
  4. adangel
    added
    in:cpdAffects the copy-paste detector
    on Jan 16, 2026
  5. adangel
    added this to the 7.25.0 milestone on May 8, 2026
  6. adangel
    added a commit that references this issue on May 8, 2026

    [doc] Update release notes (pmd#6308, pmd#6605)

    16c3d3b
  7. adangel
    closed this as completedin fe59c70on May 8, 2026
  8. adangel
    added a commit that references this issue on May 8, 2026

    [java] Fix pmd#6308: Add syntax highlighting to MarkdownRenderer (pmd…

    This issue will close once commit fe59c70 is merged into the 'main' branch.
    fe59c70
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    an:enhancementAn improvement on existing features / rulesin:cpdAffects the copy-paste detector

    Type

    No type

    Projects

    No projects

      Milestone

      • 7.25.0

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.