@ -61,11 +61,30 @@ PlasmaComponents.ListItem {
right: parent . right
}
maximumLineCount: 3
text: DisplayRole . trim ( )
text: {
var highlightFontTag = "<font color='" + theme . highlightColor + "'>%1</font>"
var text = DisplayRole
/ / f i r s t e s c a p e a n y H T M L c h a r a c t e r s t o p r e v e n t p r i v a c y i s s u e s
text = text . replace ( /&/g , "&" ) . replace ( /</g , "<" ) . replace ( />/g , ">" )
/ / c o l o r c o d e l e a d i n g o r t r a i l i n g w h i t e s p a c e
/ / t h e f i r s t r e g e x i s b a s i c a l l y " t r i m "
text = text . replace ( /^\s+|\s+$/g , function ( match ) {
/ / t h e n i n s i d e t h e t r i m m e d c h a r a c t e r s ( " m a t c h " ) w e r e p l a c e e a c h o n e i n d i v i d u a l l y
match = match . replace ( / /g , "␣" ) / / s p a c e
. replace ( /\t/g , "↹" ) / / t a b
. replace ( /\n/g , "↵" ) / / r e t u r n
return highlightFontTag . arg ( match )
} )
return text
}
visible: TypeRole == 0 / / T y p e R o l e : 0 : T e x t , 1 : I m a g e , 2 : U r l
elide: Text . ElideRight
wrapMode: Text . Wrap
textFormat: Text . PlainText
textFormat: Text . Styled Text
}
KQuickControlsAddons . QPixmapItem {
id: previewPixmap