3131//! * <https://softwareengineering.stackexchange.com/questions/222339/using-the-system-tray-notification-area-app-in-windows-7>
3232//!
3333//! For actions look at <https://docs.microsoft.com/en-us/dotnet/api/microsoft.toolkit.uwp.notifications.toastactionscustom?view=win-comm-toolkit-dotnet-7.0>
34+
35+ mod xml_escape;
36+
3437use windows:: {
3538 core:: { IInspectable , Interface } ,
3639 Data :: Xml :: Dom :: XmlDocument ,
@@ -356,10 +359,7 @@ impl Toast {
356359 /// Will be white.
357360 /// Supports Unicode ✓
358361 pub fn title ( mut self , content : & str ) -> Toast {
359- self . title = format ! (
360- r#"<text id="1">{}</text>"# ,
361- & quick_xml:: escape:: escape( content)
362- ) ;
362+ self . title = format ! ( r#"<text id="1">{}</text>"# , xml_escape:: escape( content) ) ;
363363 self
364364 }
365365
@@ -368,10 +368,7 @@ impl Toast {
368368 /// Will be grey.
369369 /// Supports Unicode ✓
370370 pub fn text1 ( mut self , content : & str ) -> Toast {
371- self . line1 = format ! (
372- r#"<text id="2">{}</text>"# ,
373- & quick_xml:: escape:: escape( content)
374- ) ;
371+ self . line1 = format ! ( r#"<text id="2">{}</text>"# , xml_escape:: escape( content) ) ;
375372 self
376373 }
377374
@@ -380,10 +377,7 @@ impl Toast {
380377 /// Will be grey.
381378 /// Supports Unicode ✓
382379 pub fn text2 ( mut self , content : & str ) -> Toast {
383- self . line2 = format ! (
384- r#"<text id="3">{}</text>"# ,
385- & quick_xml:: escape:: escape( content)
386- ) ;
380+ self . line2 = format ! ( r#"<text id="3">{}</text>"# , xml_escape:: escape( content) ) ;
387381 self
388382 }
389383
@@ -427,8 +421,8 @@ impl Toast {
427421 r#"{}<image placement="appLogoOverride" {} src="file:///{}" alt="{}" />"# ,
428422 self . images,
429423 crop_type_attr,
430- quick_xml :: escape :: escape( source. display( ) . to_string( ) ) ,
431- quick_xml :: escape :: escape( alt_text)
424+ xml_escape :: escape( source. display( ) . to_string( ) ) ,
425+ xml_escape :: escape( alt_text)
432426 ) ;
433427 self
434428 } else {
@@ -445,8 +439,8 @@ impl Toast {
445439 self . images = format ! (
446440 r#"{}<image placement="Hero" src="file:///{}" alt="{}" />"# ,
447441 self . images,
448- quick_xml :: escape :: escape( source. display( ) . to_string( ) ) ,
449- quick_xml :: escape :: escape( alt_text)
442+ xml_escape :: escape( source. display( ) . to_string( ) ) ,
443+ xml_escape :: escape( alt_text)
450444 ) ;
451445 self
452446 } else {
@@ -467,8 +461,8 @@ impl Toast {
467461 self . images = format ! (
468462 r#"{}<image id="1" src="file:///{}" alt="{}" />"# ,
469463 self . images,
470- quick_xml :: escape :: escape( source. display( ) . to_string( ) ) ,
471- quick_xml :: escape :: escape( alt_text)
464+ xml_escape :: escape( source. display( ) . to_string( ) ) ,
465+ xml_escape :: escape( alt_text)
472466 ) ;
473467 self
474468 }
0 commit comments