Skip to content

Detect code in docx #1945

Description

@lukasberbuer

Requested feature

OpenXML doesn't offer an explicit way to identify code (blocks). But we could use some detection rules, e.g. the combination of:

  • Style name lowercase includes "code"
  • Paragraph uses monospaced fonts (is there already a checker somewhere in the code base?)

What do you think?
If that's of interest, I could prepare a PR. I guess the right place would be MsWordDocumentBackend._handle_text_elements?

Metadata

Metadata

Assignees

No one assigned

    Labels

    docxissue related to docx backendenhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions