Skip to content

Commit

Permalink
Wrap description tags in CDATA (#483)
Browse files Browse the repository at this point in the history
* wrap description in CDATA

Signed-off-by: claireyywang <[email protected]>

* fix codecheck

Signed-off-by: claireyywang <[email protected]>
  • Loading branch information
claireyywang authored Feb 4, 2021
1 parent b22a595 commit b72da73
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Element.cc
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,9 @@ void Element::PrintDescription(const std::string &_prefix) const

std::cout << ">\n";

std::cout << _prefix << " <description>" << this->dataPtr->description
<< "</description>\n";
std::cout << _prefix << " <description><![CDATA["
<< this->dataPtr->description
<< "]]></description>\n";

Param_V::iterator aiter;
for (aiter = this->dataPtr->attributes.begin();
Expand All @@ -266,8 +267,9 @@ void Element::PrintDescription(const std::string &_prefix) const
<< (*aiter)->GetKey() << "' type ='" << (*aiter)->GetTypeName()
<< "' default ='" << (*aiter)->GetDefaultAsString()
<< "' required ='" << (*aiter)->GetRequired() << "'>\n";
std::cout << _prefix << " <description>" << (*aiter)->GetDescription()
<< "</description>\n";
std::cout << _prefix << " <description><![CDATA["
<< (*aiter)->GetDescription()
<< "]]></description>\n";
std::cout << _prefix << " </attribute>\n";
}

Expand Down

0 comments on commit b72da73

Please sign in to comment.