@@ -1191,36 +1191,33 @@ isEmpty(dom::Value const& arg);
1191
1191
execution. For example, the each iterator creates a single
1192
1192
frame which is reused for all child execution.
1193
1193
1194
- @param arg The value to test
1195
- @return True if the value is empty, false otherwise
1194
+ @param parent The underlying frame object
1195
+ @return The overlay object
1196
1196
1197
1197
@see https://mustache.github.io/mustache.5.html#Sections
1198
1198
*/
1199
1199
MRDOX_DECL
1200
1200
dom::Object
1201
1201
createFrame (dom::Object const & parent);
1202
1202
1203
- /* * Create child data objects .
1203
+ /* * Create a wrapper for a safe string .
1204
1204
1205
- This function can be used by block helpers to create child
1206
- data objects.
1207
-
1208
- The child data object is an overlay frame object implementation
1209
- that will first look for a value in the child object and if
1210
- not found will look in the parent object.
1205
+ This string wrapper prevents the string from being escaped
1206
+ when the template is rendered.
1211
1207
1212
- Helpers that modify the data state should create a new frame
1213
- object when doing so, to isolate themselves and avoid corrupting
1214
- the state of any parents.
1208
+ When a helper returns a safe string, it will be marked
1209
+ as safe and will not be escaped when rendered. The
1210
+ string will be rendered as if converted to a `dom::Value`
1211
+ and rendered as-is.
1215
1212
1216
- Generally, only one frame needs to be created per helper
1217
- execution. For example, the each iterator creates a single
1218
- frame which is reused for all child execution .
1213
+ When constructing the string that will be marked as safe, any
1214
+ external content should be properly escaped using the
1215
+ `escapeExpression` function to avoid potential security concerns .
1219
1216
1220
- @param arg The value to test
1221
- @return True if the value is empty, false otherwise
1217
+ @param str The string to mark as safe
1218
+ @return The safe string wrapper
1222
1219
1223
- @see https://mustache.github.io/mustache.5. html#Sections
1220
+ @see https://handlebarsjs.com/api-reference/utilities. html#handlebars-safestring-string
1224
1221
*/
1225
1222
MRDOX_DECL
1226
1223
detail::safeStringWrapper
0 commit comments