Skip to content

bug(doc): respect number of end lines in original NatSpec #4539

Open
@PaulRBerg

Description

@PaulRBerg

Component

Forge

Describe the feature you would like

forge doc does not respect the number of end lines in the original NatSpec comments. It would beg good if it did this since Markdown paragraphs are better delineated this way. For example, Prettier auto-formats one end line to an empty space.

Take this example:

/// @notice Transfers the admin of the contract to a new address.
///
/// Notes:
/// - Does not revert if the admin is the same.
/// - This function can potentially leave the contract without an admin, thereby removing any
/// functionality that is only available to the admin.
///
/// Requirements:
/// - The caller must be the current contract admin.
///
/// @param newAdmin The address of the new admin.
function transferAdmin(address newAdmin) external;

The Markdown generated by forge doc is the following:

### transferAdmin

Transfers the admin of the contract to a new address.
Notes:
- Does not revert if the admin is the same.
- This function can potentially leave the contract without an admin, thereby removing any
functionality that is only available to the admin.
Requirements:
- The caller must be the current contract admin.

I would like forge doc to keep two end lines between "to a new address." and "Notes:".

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-forgeCommand: forgeCmd-forge-docCommand: forge docT-bugType: bugfirst issueA good way to start contributing

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions