Range-diff rd-186
- title
- feat(prose): lists are back bby
- description
-
Patch changed - old #1
e265f5e- new #1
ff673f6
1: e265f5e ! 1: ff673f6 feat(prose): lists are back bby
old
new:
pkg/apps/prose/html/list.partial.tmpl
+{{define "list"}} +{{$indent := 0}} +{{$mod := 0}} +<ul style="list-style-type: {{.ListType}};"> + {{range .Items}} + {{if lt $indent .Indent}} + <ul style="list-style-type: {{$.ListType}};"> + {{else if gt $indent .Indent}} + + {{$mod = minus $indent .Indent}} + {{range $y := intRange 1 $mod}} + </li></ul> + {{end}} + + {{else}} + </li> + {{end}} + {{$indent = .Indent}} + + {{if .IsText}} + {{if .Value}} + <li>{{.Value}} + {{end}} + {{end}} + + {{if .IsURL}} + <li><a href="{{.URL}}">{{.Value}}</a> + {{end}} + + {{if .IsImg}} + <li><img src="{{.URL}}" alt="{{.Value}}" /> + {{end}} + + {{if .IsBlock}} + <li><blockquote>{{.Value}}</blockquote> + {{end}} + + {{if .IsHeaderOne}} + </ul><h2 class="text-xl font-bold">{{.Value}}</h2><ul style="list-style-type: {{$.ListType}};"> + {{end}} + + {{if .IsHeaderTwo}} + </ul><h3 class="text-lg font-bold">{{.Value}}</h3><ul style="list-style-type: {{$.ListType}};"> + {{end}} + + {{if .IsPre}} + <li><pre>{{.Value}}</pre> + {{end}} + {{end}} +</ul> +{{end}}
new
new:
pkg/apps/prose/html/list.partial.tmpl
+{{define "list"}} +{{$indent := 0}} +{{$mod := 0}} +<ul style="list-style-type: {{.ListType}};"> + {{range .Items}} + {{if lt $indent .Indent}} + <ul> + {{else if gt $indent .Indent}} + + {{$mod = minus $indent .Indent}} + {{range $y := intRange 1 $mod}} + </li></ul> + {{end}} + + {{else}} + </li> + {{end}} + {{$indent = .Indent}} + + {{if .IsText}} + {{if .Value}} + <li>{{.Value}} + {{end}} + {{end}} + + {{if .IsURL}} + <li><a href="{{.URL}}">{{.Value}}</a> + {{end}} + + {{if .IsImg}} + <li><img src="{{.URL}}" alt="{{.Value}}" /> + {{end}} + + {{if .IsBlock}} + <li><blockquote>{{.Value}}</blockquote> + {{end}} + + {{if .IsHeaderOne}} + </ul><h2 class="text-xl font-bold">{{.Value}}</h2><ul style="list-style-type: {{$.ListType}};"> + {{end}} + + {{if .IsHeaderTwo}} + </ul><h3 class="text-lg font-bold">{{.Value}}</h3><ul style="list-style-type: {{$.ListType}};"> + {{end}} + + {{if .IsPre}} + <li><pre>{{.Value}}</pre> + {{end}} + {{end}} +</ul> +{{end}}