Skip to content

VdfConvert deserializing comments somehow #38

@Redplcs

Description

@Redplcs

I've tried to deserialize file that contains some comments starts with "\" and I got some weird results. When I enumerate VToken through foreach, it sends me VValue struct with comment itself. Please fix.

VProperty subtitles = VdfConvert.Deserialize(reader: new StreamReader(subtitlesTextStream, leaveOpen: true));
VToken subtitlesTokens = subtitles.Value["Tokens"] ?? throw new InvalidDataException("Cannot find 'Tokens' property.");

foreach (VToken token in subtitlesTokens)
{
    // subtitlesTokens could send me VValue comment. why??
    if (token is VProperty property)
    {
        string key = property.Key;
        string value = property.Value.ToString();

        tokens.Add(new KeyValuePair<string, string>(key, value));
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions