mirror of
https://github.com/gethinode/hinode.git
synced 2025-10-11 12:03:10 +00:00
23 lines
825 B
HTML
23 lines
825 B
HTML
<!--
|
|
Copyright © 2024 The Hinode Team / Mark Dumay. All rights reserved.
|
|
Use of this source code is governed by The MIT License (MIT) that can be found in the LICENSE file.
|
|
Visit gethinode.com/license for more details.
|
|
-->
|
|
|
|
{{ $error := false -}}
|
|
|
|
<!-- Validate arguments -->
|
|
{{ if partial "utilities/IsInvalidArgs.html" (dict "structure" "mark" "args" .Params) }}
|
|
{{ errorf "Invalid arguments: %s" .Position -}}
|
|
{{ $error = true }}
|
|
{{ end }}
|
|
|
|
<!-- Initialize arguments -->
|
|
{{ $color := .Get "color" | default "" -}}
|
|
{{- $class := .Get "class" | default "" -}}
|
|
|
|
<!-- Main code -->
|
|
{{- if not $error -}}
|
|
{{- if $color }}{{ $class = printf "%s text-bg-%s" $class $color }}{{ end -}}
|
|
<mark{{ with $class }} class="{{ . }}"{{ end }}>{{ trim .Inner " \r\n" | .Page.RenderString -}}</mark>
|
|
{{- end -}} |