notifs: skip markdown parsing for plain text bodies
This commit is contained in:
parent
fe5195ca2e
commit
8e7ce4c6a6
1 changed files with 3 additions and 2 deletions
|
|
@ -17,6 +17,7 @@ StyledRect {
|
||||||
required property Notifs.Notif modelData
|
required property Notifs.Notif modelData
|
||||||
readonly property bool hasImage: modelData.image.length > 0
|
readonly property bool hasImage: modelData.image.length > 0
|
||||||
readonly property bool hasAppIcon: modelData.appIcon.length > 0
|
readonly property bool hasAppIcon: modelData.appIcon.length > 0
|
||||||
|
readonly property int bodyTextFormat: /[<*_`#\[\]]/.test(modelData.body) ? Text.MarkdownText : Text.PlainText
|
||||||
readonly property int nonAnimHeight: summary.implicitHeight + (root.expanded ? appName.height + body.height + actions.height + actions.anchors.topMargin : bodyPreview.height) + inner.anchors.margins * 2
|
readonly property int nonAnimHeight: summary.implicitHeight + (root.expanded ? appName.height + body.height + actions.height + actions.anchors.topMargin : bodyPreview.height) + inner.anchors.margins * 2
|
||||||
property bool expanded: Config.notifs.openExpanded
|
property bool expanded: Config.notifs.openExpanded
|
||||||
|
|
||||||
|
|
@ -347,7 +348,7 @@ StyledRect {
|
||||||
anchors.rightMargin: Appearance.spacing.small
|
anchors.rightMargin: Appearance.spacing.small
|
||||||
|
|
||||||
animate: true
|
animate: true
|
||||||
textFormat: Text.MarkdownText
|
textFormat: root.bodyTextFormat
|
||||||
text: bodyPreviewMetrics.elidedText
|
text: bodyPreviewMetrics.elidedText
|
||||||
color: Colours.palette.m3onSurfaceVariant
|
color: Colours.palette.m3onSurfaceVariant
|
||||||
font.pointSize: Appearance.font.size.small
|
font.pointSize: Appearance.font.size.small
|
||||||
|
|
@ -378,7 +379,7 @@ StyledRect {
|
||||||
anchors.rightMargin: Appearance.spacing.small
|
anchors.rightMargin: Appearance.spacing.small
|
||||||
|
|
||||||
animate: true
|
animate: true
|
||||||
textFormat: Text.MarkdownText
|
textFormat: root.bodyTextFormat
|
||||||
text: root.modelData.body
|
text: root.modelData.body
|
||||||
color: Colours.palette.m3onSurfaceVariant
|
color: Colours.palette.m3onSurfaceVariant
|
||||||
font.pointSize: Appearance.font.size.small
|
font.pointSize: Appearance.font.size.small
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue