

{{- /* Initialize. */}}
{{- $apiEndpoint := "https://math.vercel.app/" }}
{{- $color := $attrs.color | default "" }}

{{- /* Determine display mode. */}}
{{- $displayMode := true }}
{{- if or (strings.HasPrefix $inner `$$`) (strings.HasPrefix $inner `\[`) }}
    {{- $displayMode = true }}
{{- else if or (strings.HasPrefix $inner `$`) (strings.HasPrefix $inner `\(`) }}
    {{- $displayMode = false }}
{{- end }}

{{- /* Strip display mode indicators. */}}
{{- $inner = trim $inner `$` }}
{{- $inner = $inner 