How to keep a consistent figure caption and outline after changing the style of the figure caption?

I found I must restyle the content of the outline by myself. I found the following solutions, although I do not fully understand the following script.

// from: https://github.com/typst/typst/discussions/4515
#show outline.entry: it=> if <no-prefix> != it.fields().at(
    default: {},
    "label",
) [#outline.entry(
    it.level,
    it.element,
    {
        [*#it.element.caption.supplement *]
        [*#numbering(
            it.element.numbering,
            ..it.element.counter.at(it.element.location()),
        )*]
        [*.* ]
        // figure.caption.separator
        it.element.caption.body
    },
    it.fill,
    [#it.page]
)<no-prefix>] else {it}