apply changes from code review

This commit is contained in:
Hubert Chathi 2022-10-26 16:33:41 -04:00
parent 089f1fee7d
commit d6345f0df2
3 changed files with 21 additions and 6 deletions

View file

@ -1,4 +1,13 @@
{{ $example_content := partial "json-schema/resolve-refs" (dict "schema" .example "path" "event-schemas/examples") }}
{{/*
Renders an event example. Resolves `$ref`s, serializes as JSON, and ensures
that it can be included in HTML.
This partial is called with the example data as its context.
*/}}
{{ $example_content := partial "json-schema/resolve-refs" (dict "schema" . "path" "event-schemas/examples") }}
{{ $example_json := jsonify (dict "indent" " ") $example_content }}
{{ $example_json = replace $example_json "\\u003c" "<" }}
{{ $example_json = replace $example_json "\\u003e" ">" | safeHTML }}