mrdocs::reindentCode

Reindent code by removing the common leading spaces and adding the specified indent.

Synopsis

Declared in <mrdocs/Support/String/String.hpp>

std::string
reindentCode(
    std::string_view code,
    std::size_t indent = 0);

Return Value

The modified code block.

Parameters

NameDescription
codeThe code block to unindent.
indentThe number of spaces to insert in front of each line after trimming.