summaryrefslogtreecommitdiffstats
path: root/templates/content.html
diff options
context:
space:
mode:
Diffstat (limited to 'templates/content.html')
-rw-r--r--templates/content.html20
1 files changed, 8 insertions, 12 deletions
diff --git a/templates/content.html b/templates/content.html
index 73f18c7..4616a10 100644
--- a/templates/content.html
+++ b/templates/content.html
@@ -37,7 +37,7 @@
{{- if eq .Name "table" -}}
<table class="cnm-table">
- {{- range .Rows -}}
+ {{- range .Children -}}
{{- template "content.html" . -}}
{{- end -}}
</table>
@@ -79,19 +79,15 @@
{{- end -}}
{{- if eq .Name "text" -}}
- {{- if eq .Format "" "plain"}}{{range .Contents.Paragraphs -}}
-<p class="cnm-text">{{.}}</p>
- {{- end}}{{end -}}
- {{- if eq .Format "fmt" -}}
- {{- range .Contents.Paragraphs -}}
- {{- cnmfmt . -}}
- {{- end -}}
- {{- end -}}
- {{- if not (eq .Format "" "plain" "fmt") -}}
-<pre class="cnm-text cnm-text-pre">{{.Contents.Text}}</pre>
+ {{- if eq .Format "" "plain" "pre" "fmt" -}}
+ {{- if eq .Format "" "plain"}}{{range .Contents.Paragraphs}}<p class="cnm-text">{{.}}</p>{{end}}{{end -}}
+ {{- if eq .Format "pre"}}<pre class="cnm-text cnm-text-pre">{{.Contents.Text}}</pre>{{end -}}
+ {{- if eq .Format "fmt"}}{{range .Contents.Paragraphs}}{{cnmfmt .}}{{end}}{{end -}}
+ {{- else -}}
+ <pre class="cnm-text cnm-text-raw">{{.Contents.Text}}</pre>
{{- end -}}
{{- end -}}
{{- if eq .Name "raw" -}}
-<pre class="cnm-raw"><code class="cnm-raw-{{lang .Syntax}}">{{.Contents}}</code></pre>
+<pre class="cnm-raw"><code class="cnm-raw-{{lang .Syntax}}">{{.Contents.Text}}</code></pre>
{{- end -}}