def multiscalar_representer(dumper, data):
    """Special representer for multiline scalar strings.  This formats
    the string using pipe and multiple lines.
    """
    return dumper.represent_scalar(
        'tag:yaml.org,2002:str',
        data,
        style='|'
    )