Skip to content

Quotes from doc comments are unnecessarily escaped #885

Closed
@andreymal

Description

@andreymal

I literally copied godot/tests/docs.rs into a new project and got this:

gdext-escaped-quotes

The quotes are "double"-escaped because of Rust string literals:

.flat_map(|doc| {
doc.into_iter().map(|x| {
x.to_string()
.trim_start_matches('r')
.trim_start_matches('#')
.trim_start_matches('"')
.trim_end_matches('#')
.trim_end_matches('"')
.to_string()
})
})

Can probably be fixed with litrs:

        .flat_map(|doc| {
            doc.into_iter().map(|x| {
                litrs::StringLit::parse(x.to_string()).unwrap().value().to_string()
            })
        })

but not sure adding a new dependency is a good idea

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugc: registerRegister classes, functions and other symbols to GDScriptgood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions