Skip to content

Generated JSON documentation no longer includes methods field. #31290

@Me1000

Description

@Me1000
  • Version: 13.6.0

PR #31086 Changed the markdown styling for documentation. This introduced a bug in the JSON documentation which gets generated with the release. Specifically the methods field is no longer there:

e.g. in 13.5.0:

 source: 'node/doc/api/assert.md', modules: [ { textRaw: 'Assert', name: 'assert', introduced_in: 'v0.1.21', stability: 2, stabilityText: 'Stable', desc: '<p>The <code>assert</code> module provides a set of assertion functions for verifying\n' + 'invariants. The module provides a recommended <code>strict</code> mode and a more\n' + 'lenient legacy mode.</p>\n', classes: [Array], modules: [Array], methods: [Array], type: 'module', displayName: 'Assert' } ] } 

In 13.6.0 ▶️:

 source: 'node/doc/api/assert.md', modules: [ { textRaw: 'Assert', name: 'assert', introduced_in: 'v0.1.21', stability: 2, stabilityText: 'Stable', desc: '<p>The <code>assert</code> module provides a set of assertion functions for verifying\n' + 'invariants. The module provides a recommended <code>strict</code> mode and a more\n' + 'lenient legacy mode.</p>\n', classes: [Array], modules: [Array], type: 'module', displayName: 'Assert' } ] } 

It looks like this regex no longer matched: https://github.com/nodejs/node/blob/master/tools/doc/json.js#L475

Since they're really only used for the HTML styling, I think a simple fix might be to just strip the tick marks here:

const text = textJoin(header.children, file);

- const text = textJoin(header.children, file); + const text = textJoin(header.children, file).replace(/`/g, "");

I can submit a PR if others agree with this simple solution.

EDIT: Unfortunately that simple solution will not work. There were some existing headings with tick marks that parse incorrectly if they're removed. Continuing to investigate, but I'm still not super familiar with this code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions