I am close, but do not understand why it is not working.
When using display and then $escapetool.html(String) I get the HTML. However it doesn’t show in the JSON, only in the WIKI page.
in the JSON:
##loop through results
#set($docOmschrijving=$objitem.getProperty("omschrijving").value)
##If changed to below I do get HTML output in WIKI page but $docOmschrijving returns "" in the JSON.
##set($docOmschrijving=$docitem.display("omschrijving"))
##set($docOmschrijving=$escapetool.html($docOmschrijving))
##Line below adds a row to the json.
#set($discard=$json.rows.add({
"doc_viewable" : true,
"doc_url" : "$docURL",
"doc_edit_url" : "$docEditURL",
"doc_delete_url" :"$docDeleteURL",
"afkorting" : "$docAfkorting",
"naam" : "$docNaam",
"omschrijving" :"$docOmschrijving",
}))
#end
##output the json:
$jsontool.serialize($json)