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
2 changes: 2 additions & 0 deletions src/auth/ha-auth-flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class HaAuthFlow extends litLocalizeLiteMixin(LitElement) {
${this.localize("ui.panel.page-authorize.abort_intro")}:
<ha-markdown
allowsvg
breaks
.content=${this.localize(
`ui.panel.page-authorize.form.providers.${step.handler[0]}.abort.${step.reason}`
)}
Expand All @@ -113,6 +114,7 @@ class HaAuthFlow extends litLocalizeLiteMixin(LitElement) {
${this._computeStepDescription(step)
? html`
<ha-markdown
breaks
.content=${this._computeStepDescription(step)}
></ha-markdown>
`
Expand Down
4 changes: 3 additions & 1 deletion src/components/ha-markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class HaMarkdown extends UpdatingElement {

@property({ type: Boolean }) public allowSvg = false;

@property({ type: Boolean }) public breaks = false;

protected update(changedProps) {
super.update(changedProps);

Expand All @@ -26,7 +28,7 @@ class HaMarkdown extends UpdatingElement {
this.innerHTML = await worker.renderMarkdown(
this.content,
{
breaks: true,
breaks: this.breaks,
gfm: true,
tables: true,
},
Expand Down
24 changes: 20 additions & 4 deletions src/dialogs/config-flow/show-dialog-config-flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ export const showConfigFlowDialog = (
);

return description
? html` <ha-markdown allowsvg .content=${description}></ha-markdown> `
? html`
<ha-markdown allowsvg breaks .content=${description}></ha-markdown>
`
: "";
},

Expand All @@ -78,7 +80,9 @@ export const showConfigFlowDialog = (
step.description_placeholders
);
return description
? html` <ha-markdown allowsvg .content=${description}></ha-markdown> `
? html`
<ha-markdown allowsvg breaks .content=${description}></ha-markdown>
`
: "";
},

Expand Down Expand Up @@ -112,7 +116,13 @@ export const showConfigFlowDialog = (
)}
</p>
${description
? html` <ha-markdown allowsvg .content=${description}></ha-markdown> `
? html`
<ha-markdown
allowsvg
breaks
.content=${description}
></ha-markdown>
`
: ""}
`;
},
Expand All @@ -128,7 +138,13 @@ export const showConfigFlowDialog = (

return html`
${description
? html` <ha-markdown allowsvg .content=${description}></ha-markdown> `
? html`
<ha-markdown
allowsvg
breaks
.content=${description}
></ha-markdown>
`
: ""}
<p>
${hass.localize(
Expand Down
16 changes: 14 additions & 2 deletions src/dialogs/config-flow/show-dialog-options-flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,13 @@ export const showOptionsFlowDialog = (
);

return description
? html` <ha-markdown allowsvg .content=${description}></ha-markdown> `
? html`
<ha-markdown
breaks
allowsvg
.content=${description}
></ha-markdown>
`
: "";
},

Expand All @@ -69,7 +75,13 @@ export const showOptionsFlowDialog = (
step.description_placeholders
);
return description
? html` <ha-markdown allowsvg .content=${description}></ha-markdown> `
? html`
<ha-markdown
allowsvg
breaks
.content=${description}
></ha-markdown>
`
: "";
},

Expand Down
1 change: 1 addition & 0 deletions src/dialogs/more-info/controls/more-info-configurator.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class MoreInfoConfigurator extends PolymerElement {
<div class="layout vertical">
<template is="dom-if" if="[[isConfigurable]]">
<ha-markdown
breaks
content="[[stateObj.attributes.description]]"
></ha-markdown>

Expand Down
5 changes: 4 additions & 1 deletion src/dialogs/notifications/persistent-notification-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ export class HuiPersistentNotificationItem extends LitElement {
${this.notification.title}
</span>

<ha-markdown content="${this.notification.message}"></ha-markdown>
<ha-markdown
breaks
content="${this.notification.message}"
></ha-markdown>

<div class="time">
<span>
Expand Down
1 change: 1 addition & 0 deletions src/panels/lovelace/cards/hui-markdown-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export class HuiMarkdownCard extends LitElement implements LovelaceCard {
return html`
<ha-card .header="${this._config.title}">
<ha-markdown
breaks
class="markdown ${classMap({
"no-header": !this._config.title,
})}"
Expand Down
2 changes: 2 additions & 0 deletions src/panels/profile/ha-mfa-module-setup-flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class HaMfaModuleSetupFlow extends LocalizeMixin(EventsMixin(PolymerElement)) {
<template is="dom-if" if="[[_equals(_step.type, 'abort')]]">
<ha-markdown
allowsvg
breaks
content="[[_computeStepAbortedReason(localize, _step)]]"
></ha-markdown>
</template>
Expand All @@ -95,6 +96,7 @@ class HaMfaModuleSetupFlow extends LocalizeMixin(EventsMixin(PolymerElement)) {
>
<ha-markdown
allowsvg
breaks
content="[[_computeStepDescription(localize, _step)]]"
></ha-markdown>
</template>
Expand Down