def change_style(style, representer):
    """
    This function is used to format the key value as a multi-line string maintaining the line breaks
    """

    def new_representer(dumper, data):
        scalar = representer(dumper, data)
        scalar.style = style
        return scalar

    return new_representer