Edit in JSFiddle

var _=ishml.Template
var inside=box=>_`Inside the ${box} was a ${_.favor(_.pick("steel strongbox","wooden casket","silk bag","paper sack","old purse"),
_.pick("ring","ancient coin", "ruby")).tag("contents")}. 
${tags=>tags.contents.data.index===0?inside(tags.contents.text):""}
${_`She put the ${tags=>tags.contents.text} back in the ${box}. `}`

var example1=_`Cas looked under the bed and found a package wrapped with a red ribbon.  Carefully, she unwrapped the package. 
${inside("package")}Cas rewrapped the package and put it back under the bed.  ${_.pick("No one would be the wiser. ", 
"Now she knew. ", "She was elated. ", "She was disappointed.")}`

var demo=function()
{
   example1.say().replace("#paragraph1")
}