Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Triple-quoted strings result in an error #2

Open
mgeisler opened this issue Apr 19, 2022 · 2 comments
Open

Triple-quoted strings result in an error #2

mgeisler opened this issue Apr 19, 2022 · 2 comments

Comments

@mgeisler
Copy link

Hi there!

When trying to set the version number for a crate (my lipsum crate) which uses triple-quoted strings, I get an error:

Error: Mismatch between location and raw string, expected 7 lines for """"
Lipsum is a lorem ipsum text generation library. Use this if you need
filler or dummy text for your application.

The text is generated using a simple Markov chain, which you can also
instantiate to generate your own pieces of pseudo-random text.
""""

The Cargo.toml file has a triple-quoted description:

[package]
name = "lipsum"
version = "0.8.0"
authors = ["Martin Geisler <[email protected]>"]
description = """
Lipsum is a lorem ipsum text generation library. Use this if you need
filler or dummy text for your application.

The text is generated using a simple Markov chain, which you can also
instantiate to generate your own pieces of pseudo-random text.
"""
documentation = "https://docs.rs/lipsum/"
repository = "https://github.com/mgeisler/lipsum/"
readme = "README.md"

To the best of my knowledge, this is a valid TOML file, but it somehow triggers the above error. I wasn't able to figure out what the problem is.

mgeisler added a commit to mgeisler/rust-release-gh-action that referenced this issue Apr 19, 2022
When trying to set the version number for a crate (my lipsum crate)
which uses triple-quoted strings, I get an error:

    Error: Mismatch between location and raw string, expected 7 lines for """"
    Lipsum is a lorem ipsum text generation library. Use this if you need
    filler or dummy text for your application.

    The text is generated using a simple Markov chain, which you can also
    instantiate to generate your own pieces of pseudo-random text.
    """"

This is now reported as thomaseizinger/set-crate-version#2, and in the
meantime, we’ll simply use Python to do the search-and-replace.
@thomaseizinger
Copy link
Owner

thomaseizinger commented Apr 27, 2022

Thanks for the report!

I almost certain that this is a problem with the toml parsing library that we are using: https://github.com/timhall/toml-patch

If you can reproduce the problem with just that library, do you mind opening this issue upstream?

@mgeisler
Copy link
Author

mgeisler commented May 4, 2022

Yeah, it's reproducible upstream, I opened timhall/toml-patch#25 to track this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants