{{ $error := false -}} {{ if partial "utilities/IsInvalidArgs.html" (dict "structure" "carousel" "args" .Params ) }} {{ errorf "Invalid arguments: %s" .Position -}} {{ $error = true }} {{ end }} {{- $id := .Get "id" | default (printf "carousel-%d" .Ordinal) -}} {{ $class := .Get "class" | default "" -}} {{ $inner := .Scratch.Get "inner" }} {{ $input := trim .Inner " \r\n" }} {{ if $input }} {{ $input = replace $input "\n" "\n " }} {{ warnf "Unexpected inner content: %s\r\n %s" .Position $input }} {{ end }} {{ $items := len (findRE "carousel-item" $inner) -}}