Skip to content

Commit ffa5461

Browse files
scr-oathsparkprime
authored andcommitted
Documents the escapeStringXml added in #1038
See: - <#1037> - <#1038>
1 parent b160b06 commit ffa5461

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

doc/_stdlib_gen/stdlib-content.jsonnet

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,22 @@ local html = import 'html.libsonnet';
522522
<code>std.escapeStringJson</code>.
523523
|||,
524524
},
525+
{
526+
name: 'escapeStringXml',
527+
params: ['str'],
528+
description: |||
529+
Convert <code>str</code> to allow it to be embedded in XML (or HTML). The following replacements are made:
530+
<pre>
531+
{
532+
"&lt;": "&amp;lt;",
533+
"&gt;": "&amp;gt;",
534+
"&amp;": "&amp;amp;",
535+
"\&quot;": "&amp;quot;",
536+
"&apos;": "&amp;apos;",
537+
}
538+
</pre>
539+
|||,
540+
},
525541
],
526542
},
527543
{

doc/ref/stdlib.html

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,6 +1093,37 @@ <h4 id="escapeStringPython">
10931093
</div>
10941094
</div>
10951095

1096+
<div class="hgroup">
1097+
<div class="hgroup-inline">
1098+
<div class="panel">
1099+
<h4 id="escapeStringXml">
1100+
std.escapeStringXml(str)
1101+
</h4>
1102+
</div>
1103+
<div style="clear: both"></div>
1104+
</div>
1105+
</div>
1106+
<div class="hgroup">
1107+
<div class="hgroup-inline">
1108+
<div class="panel">
1109+
<p>
1110+
Convert <code>str</code> to allow it to be embedded in XML (or HTML). The following replacements are made:
1111+
<pre>
1112+
{
1113+
"&lt;": "&amp;lt;",
1114+
"&gt;": "&amp;gt;",
1115+
"&amp;": "&amp;amp;",
1116+
"\&quot;": "&amp;quot;",
1117+
"&apos;": "&amp;apos;",
1118+
}
1119+
</pre>
1120+
</p>
1121+
1122+
</div>
1123+
<div style="clear: both"></div>
1124+
</div>
1125+
</div>
1126+
10961127

10971128
<div class="hgroup">
10981129
<div class="hgroup-inline">

0 commit comments

Comments
 (0)