csharp: Escape contents of struct fields' value tag.

Summary:
In structs' definition, field `<value>` tags weren't scaping
characters, so characters like "&" would lead to invalid XML errors.

Fixes T8588.

Test Plan: Run ninja test.

Reviewers: segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8588

Differential Revision: https://phab.enlightenment.org/D11202
This commit is contained in:
João Paulo Taylor Ienczak Zanette 2020-01-27 17:51:53 +01:00 committed by Xavi Artigas
parent fdf0aee35c
commit 5d982dd985
1 changed files with 3 additions and 2 deletions

View File

@ -564,12 +564,13 @@ struct struct_definition_generator
// iterate struct fields
for (auto const& field : struct_.fields)
{
if (!as_generator(documentation(indent.n + 1)).generate(sink, field, context))
auto docs = documentation(indent.n + 1);
if (!as_generator(docs).generate(sink, field, context))
return false;
if (!field.type.doc_summary.empty())
{
if (!as_generator(indent << scope_tab << "/// <value>" << field.type.doc_summary << "</value>\n").generate(sink, attributes::unused, context))
if (!docs.generate_tag_value(sink, field.type.doc_summary, context))
return false;
}