MCPcopy Create free account
hub / github.com/apache/cloudberry / html_escaped_print

Function html_escaped_print

src/fe_utils/print.c:1838–1876  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1836
1837
1838void
1839html_escaped_print(const char *in, FILE *fout)
1840{
1841 const char *p;
1842 bool leading_space = true;
1843
1844 for (p = in; *p; p++)
1845 {
1846 switch (*p)
1847 {
1848 case '&':
1849 fputs("&", fout);
1850 break;
1851 case '<':
1852 fputs("&lt;", fout);
1853 break;
1854 case '>':
1855 fputs("&gt;", fout);
1856 break;
1857 case '\n':
1858 fputs("<br />\n", fout);
1859 break;
1860 case '"':
1861 fputs("&quot;", fout);
1862 break;
1863 case ' ':
1864 /* protect leading space, for EXPLAIN output */
1865 if (leading_space)
1866 fputs("&nbsp;", fout);
1867 else
1868 fputs(" ", fout);
1869 break;
1870 default:
1871 fputc(*p, fout);
1872 }
1873 if (*p != ' ')
1874 leading_space = false;
1875 }
1876}
1877
1878
1879static void

Callers 3

print_html_textFunction · 0.85
print_html_verticalFunction · 0.85
PrintQueryStatusFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected