modify_headings_offset

Function modify_headings_offset 

Source
pub fn modify_headings_offset(text: &str, offset: i8) -> String
Expand description

Modify the headings offset of Markdown content.

Only works for number sign (#) headings syntax.

This function is secure, so if you try to decrease the offset of a heading to a negative value that exceeds the top level heading, it will be set to the minimum valid possible to not modify the hierarchy of section nodes.

Args: text (str): Text to modify. offset (int): Relative offset for headings, can be a positive or a negative number.

Returns: str: New modified content.