[editor] remove error messages from CS comment and enforce OSM 255 char length limit (#919)

Signed-off-by: map-per <map-per@gmx.de>
This commit is contained in:
map-per
2025-10-26 20:16:56 +01:00
committed by map-per
parent bab74782f8
commit 310287e918
4 changed files with 49 additions and 19 deletions

View File

@@ -173,6 +173,29 @@ inline constexpr bool IsASCIISpace(T c)
bool IsASCIILatin(UniChar c);
/// Escape characters not allowed in XML
template <typename T>
std::string EscapeForXML(const T & in)
{
std::string result;
result.reserve(in.size());
for (char c : in)
{
switch (c)
{
case '&': result.append("&amp;"); break;
case '<': result.append("&lt;"); break;
case '>': result.append("&gt;"); break;
case '"': result.append("&quot;"); break;
case '\'': result.append("&apos;"); break;
default: result.append(1, c); break;
}
}
return result;
}
inline std::string DebugPrint(UniString const & s)
{
return ToUtf8(s);