Skip to content

Keep leading spaces in code block #140

@AndreVirtimo

Description

@AndreVirtimo

Hello,

I have followed the guide to disable the creation of <p> for blank line. Now I have the problem that the IntelliJ formatting removes the leading spaces in my code block.

Example

Before:

/**
   * Update a user by providing the data as JSON in the body.
   *
   * .Example body
   * [source,json]
   * ----
   * {
   *      "firstName": "Hans",
   *      "lastName": "Test",
   *      "email": "[email protected]"
   * }
   * ----
   *
   */

After:

/**
   * Update a user by providing the data as JSON in the body.
   *
   * .Example body
   * [source,json]
   * ----
   * {
   * "firstName": "Hans",
   * "lastName": "Test",
   * "email": "[email protected]"
   * }
   * ----
   *
   */

As a workaround I can add

// @formatter:off
// @formatter:on

But I don't want to. Is there any other solution?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions