MCPcopy Create free account
hub / github.com/aboSamoor/pycld2 / GetHtmlEscapedText

Function GetHtmlEscapedText

cld2/internal/debug.cc:225–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223}
224
225string GetHtmlEscapedText(const string& txt) {
226 string retval;
227 retval.clear();
228 for (int i = 0; i < static_cast<int>(txt.size()); ++i) {
229 char c = txt[i];
230 if (c == '<') {
231 retval.append("&lt;");
232 } else if (c == '>') {
233 retval.append("&gt;");
234 } else if (c == '&') {
235 retval.append("&amp;");
236 } else if (c == '\'') {
237 retval.append("&apos;");
238 } else if (c == '"') {
239 retval.append("&quot;");
240 } else if (c == '\n') {
241 retval.append(" ");
242 } else if (c == '\r') {
243 retval.append(" ");
244 } else {
245 retval.append(1, c);
246 }
247 }
248 return retval;
249}
250
251string GetColorHtmlEscapedText(Language lang, const string& txt) {
252 char temp[64];

Callers 8

ItemToVectorFunction · 0.70
SummaryBufferToVectorFunction · 0.70
JustOneItemToVectorFunction · 0.70
BetterBoundaryFunction · 0.70
ScoreOneScriptSpanFunction · 0.70
PrintHtmlEscapedTextFunction · 0.70
DetectLanguageSummaryV2Function · 0.70
GetColorHtmlEscapedTextFunction · 0.70

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected