Ok, here's a patch. Please let me know if this is acceptable or not.

On Sat, Jun 22, 2024 at 8:33 AM Ihor Radchenko <yantar92@posteo.net> wrote:
Nathan Nichols <nathannichols454@gmail.com> writes:

>> This looks like a copy-paste of `org-element-normalize-string'.
>> Why not simply calling `org-element-normalize-string'?
>
> I changed it at one point, but then changed it back and didn't realize that
> it was ultimately unchanged.
> Here's a patch that uses `org-element-normalize-string` instead.

Thanks!

> +(defun org-html-normalize-str-or-fn (input &rest trailing)
> +  "If INPUT is a string, it is passed to `org-element-normalize-string'.

Ideally, the first line of the docstring should fully describe what
function does.

Maybe you can add something like

   Normalize INPUT function or string.  Return a string or nil.

> +If INPUT is a function, it is applied to arguments TRAILING, and the result is
> +passed to `org-element-normalize-string'."
> +  (let ((s (if (functionp input) (format "%s" (apply input trailing)) input)))
> +    (org-element-normalize-str s)))
       ^org-element-normalize-string

TRAILING name is confusing because it is not what one expects to be a
name of function arguments.  Maybe

    (defun org-html-normalize-str-or-fn (input &rest args)


Also, you need to update docstrings and type definitions for
`org-html-head' and `org-html-head-extra', update the Org manual, and
announce the new allowed values in etc/ORG-NEWS.

--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>