Markdown problem

you might not have my horizontal-filler… only use the - type: markdown bit? Maybe even take out the style section to be sure.

 - type: markdown
    content: >
      Snapshots
      {%- for sh in state_attr('sensor.snapshot_backup','snapshots') %}
        - name: {{sh.name}}
          date: {{as_timestamp(sh.date)|timestamp_custom('%d %b: %X')}}
          time: {{sh.state}}
      {%- endfor %}

My card is:

                  - type: markdown
                    style: |
                      ha-card {
                      font-size: 14px;
                      font-family: 'Times New Roman';
                      font-weight: bold;
                      }                                    
                    content: >
                      {%- for sh in state_attr('sensor.snapshot_backup','snapshots') %}
                        - name: {{sh.name }}
                          date: {{as_timestamp(sh.date)|timestamp_custom('%d %b: %X') }}
                          time: {{sh.state }}
                      {%- endfor %}

But don’t get what you get…

latest version of the card mod?

no errors in the inspector?

copied your code and this it what’s showing:

00

It’s really strange as when reloading the card for a moment i get what i want, but then it comes again like i show you… card-mod is the latest.
In inspector i get these errors but i don’t think they are related

edited it a bit, try this for now without the style:

      - type: markdown
        content: |
          Snapshots
          {%- for sh in state_attr('sensor.snapshot_backup','snapshots') %}
            - name: {{sh.name}}
              date: {{as_timestamp(sh.date)|timestamp_custom('%d %b: %X')}}
              time: {{sh.state}}
          {%- endfor %}

fixed it on this side:

21

with your style:
27

You’ve got to be precise not to leave trailing spaces, and also use the spacing in the stacks/configs themselves. Markdown is really exact in what you feed it.

check this for some old-school Markdown:

No way…

Meaning? It’s ok now?

No, always same look…

bummer., don’t know what to say really, maybe the HA version itself? Do you have other markdown card issues? Markdown has been updated, but I think it has been a while.

Yes, i have other markdown cards that work as expected…
Still having this:

05

just to be sure, create a new tab with only this card. Ruling out any other interference of another card in the same view.

Still seems to be the old Markdown, not recognizing Jinja templates… what HA version are you on? .98 updated the Markdown: 0.98: Improved entity management, options and Home Assistant Alerts

1 Like

It’s what i am doing now… i am running 0.101.3 with hassio.

really really sorry, I am out of ideas…

are you using custom markdown cards? [[]] indicates you are.

1 Like

Yes, that’s the problem, i discovered inside the resources part of ui-lovelace i still had markdown-mod custom card… now removed it and voilà… it works !!
But now i must modify all my markdown cards ?
The answer is yes… now i have problem with other markdown cards… how to change them in place of [] ?

seems like it. I don’t know if the code is 1 to 1. You’d probably need to add states. to all your current state objects and replace [] with {{ }}.

1 Like

as said, markdown excepts full jinja templating, so simply use templates that work inside the template editor, and you’ll be good.

of course, you can also still use Markdown, and, if you have card-mod installed, use style:
best of three worlds :wink:

:pray::point_up:

only now notice I copied the ‘incorrect’ name for the 3d sensor, which would better be called state: (vs time: ) imho.

01

Yes, i already changed them and translated into italian :slight_smile: