Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion gallery/src/pages/lovelace/markdown-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const CONFIGS = [
heading: "markdown-it demo",
config: `
- type: markdown
content: >
content: >-
# h1 Heading 8-)

## h2 Heading
Expand Down Expand Up @@ -249,6 +249,17 @@ const CONFIGS = [
::: warning
*here be dragons*
:::

### ha-alert

You can use our [\`ha-alert\`](https://design.home-assistant.io/#components/ha-alert) component in markdown content rendered in the Home Assistant Frontend.

<ha-alert alert-type="error">This is an error alert — check it out!</ha-alert>
<ha-alert alert-type="warning">This is a warning alert — check it out!</ha-alert>
<ha-alert alert-type="info">This is an info alert — check it out!</ha-alert>
<ha-alert alert-type="success">This is a success alert — check it out!</ha-alert>
<ha-alert title="Test alert">This is an alert with a title</ha-alert>

`,
},
];
Expand Down
1 change: 1 addition & 0 deletions src/resources/markdown_worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const renderMarkdown = (
input: ["type", "disabled", "checked"],
"ha-icon": ["icon"],
"ha-svg-icon": ["path"],
"ha-alert": ["alert-type", "title"],
};
}

Expand Down