Skip to content

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

@gilprime

Description

@gilprime

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

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions