-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update dependency @bundle-stats/plugin-webpack-filter to v4.15.0 (#21837) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update dependency marked to v14.1.0 (#21829) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Bump actions/upload-artifact from 4.3.6 to 4.4.0 (#21850) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.6 to 4.4.0. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](actions/upload-artifact@v4.3.6...v4.4.0) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add padding to no info badge (#21844) * Add padding to no info badge * Update src/panels/lovelace/badges/hui-entity-badge.ts Co-authored-by: Paul Bottein <[email protected]> --------- Co-authored-by: Paul Bottein <[email protected]> * Fix section not displayed when empty and string config (#21852) * Move edit mode actions next to section block (#21840) * Fix rendering of alerts in markdown when not breaking (#21856) * Perform action on every entity (#21845) * Bumped version to 20240902.0 --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Simon Lamon <[email protected]> Co-authored-by: Joakim Sørensen <[email protected]>
- Loading branch information
1 parent
22de449
commit d9ce209
Showing
13 changed files
with
241 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
title: Markdown | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
import { css, html, LitElement } from "lit"; | ||
import "../../../../src/components/ha-card"; | ||
import "../../../../src/components/ha-markdown"; | ||
|
||
import { customElement } from "lit/decorators"; | ||
|
||
interface MarkdownContent { | ||
content: string; | ||
breaks: boolean; | ||
allowSvg: boolean; | ||
lazyImages: boolean; | ||
} | ||
|
||
const mdContentwithDefaults = (md: Partial<MarkdownContent>) => | ||
({ | ||
breaks: false, | ||
allowSvg: false, | ||
lazyImages: false, | ||
...md, | ||
}) as MarkdownContent; | ||
|
||
const generateContent = (md) => ` | ||
\`\`\`json | ||
${JSON.stringify({ ...md, content: undefined })} | ||
\`\`\` | ||
--- | ||
${md.content} | ||
`; | ||
|
||
const markdownContents: MarkdownContent[] = [ | ||
mdContentwithDefaults({ | ||
content: "_Hello_ **there** 👋, ~~nice~~ of you ||to|| show up.", | ||
}), | ||
...[true, false].map((breaks) => | ||
mdContentwithDefaults({ | ||
breaks, | ||
content: ` | ||
![image](https://img.shields.io/badge/markdown-rendering-brightgreen) | ||
![image](https://img.shields.io/badge/markdown-rendering-blue) | ||
> [!TIP] | ||
> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer dictum quis ante eu eleifend. Integer sed [consectetur est, nec elementum magna](#). Fusce lobortis lectus ac rutrum tincidunt. Quisque suscipit gravida ante, in convallis risus vulputate non. | ||
key | description | ||
-- | -- | ||
lorem | ipsum | ||
- list item 1 | ||
- list item 2 | ||
`, | ||
}) | ||
), | ||
]; | ||
|
||
@customElement("demo-misc-ha-markdown") | ||
export class DemoMiscMarkdown extends LitElement { | ||
protected render() { | ||
return html` | ||
<div class="container"> | ||
${markdownContents.map( | ||
(md) => | ||
html`<ha-card> | ||
<ha-markdown | ||
.content=${generateContent(md)} | ||
.breaks=${md.breaks} | ||
.allowSvg=${md.allowSvg} | ||
.lazyImages=${md.lazyImages} | ||
></ha-markdown> | ||
</ha-card>` | ||
)} | ||
</div> | ||
`; | ||
} | ||
|
||
static get styles() { | ||
return css` | ||
ha-card { | ||
margin: 12px; | ||
padding: 12px; | ||
} | ||
`; | ||
} | ||
} | ||
|
||
declare global { | ||
interface HTMLElementTagNameMap { | ||
"demo-misc-ha-markdown": DemoMiscMarkdown; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.