on xenial help sign in
Replace newlines with <br /> for RichText.
commita7caea99e6b2222cf36a7a8786161c939c26e295 authorMichał Sawicz <michal.sawicz@canonical.com> dateFri 16 Aug 2013, 11:06 (13 years ago) parentc2da3ac
1 file changed+4−2
Dash/Generic/GenericPreview.qml+4−2
Dash/Generic/GenericPreview.qml+4−2
@@ -79,7 +79,8 @@ DashPreview {
7979 fontSize: "medium"
8080 opacity: 0.6
8181 color: "white"
82− text: previewData.subtitle
82+ // TODO: should backend come back with <br /> already?
83+ text: previewData.subtitle.replace(/[\r\n]+/g, "<br />")
8384 style: Text.Raised
8485 styleColor: "black"
8586 wrapMode: Text.WordWrap
@@ -94,7 +95,8 @@ DashPreview {
9495 fontSize: "small"
9596 opacity: 0.6
9697 color: "white"
97− text: previewData.description
98+ // TODO: should backend come back with <br /> already?
99+ text: previewData.description.replace(/[\r\n]+/g, "<br />")
98100 style: Text.Raised
99101 styleColor: "black"
100102 wrapMode: Text.WordWrap