Skip to content

{@includeCode} with regions doesn't work on windows saved files (LFCR) #2902

Closed
@IveGotThePawa

Description

@IveGotThePawa

Search terms

includeCode
region
windows
LFCR
end of line
\r\n
\n

Expected Behavior

{@includecode file#region} should find region even in windows saved files

Actual Behavior

inline tag {@includecode} with a filePath#region doesn't work if the target file was saved with windows end-of-line characters. The include_0_tag_in_1_specified_2_file_3_region_4_region_not_found error is always displayed.

Just check the regexes in src/lib/converter/plugins/IncludePlugin.ts

They should all be changed from *\n to *\r?\n

Steps to reproduce the bug

use a target file that has been saved with \r\n end-of-line characters.

You should also include TSX extension files, not just TS (react support)

Environment

  • Typedoc version: 0.27.9
  • TypeScript version: 5
  • Node.js version: 20
  • OS: windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions