@@ -7,6 +7,7 @@ class PresetsDetailedDialog {
77 this . _finalDialogYesNoSettings = { } ;
88 this . _onPresetPickedCallback = onPresetPickedCallback ;
99 this . _openPromiseResolve = undefined ;
10+ this . _isDescriptionHtml = false ;
1011 }
1112
1213 load ( ) {
@@ -57,7 +58,7 @@ class PresetsDetailedDialog {
5758 }
5859
5960 _loadPresetUi ( ) {
60- this . _domDescription . text ( this . _preset . description ?. join ( "\n" ) ) ;
61+ this . _loadDescription ( ) ;
6162
6263 this . _domGitHubLink . attr ( "href" , this . _presetsRepo . getPresetOnlineLink ( this . _preset ) ) ;
6364
@@ -76,6 +77,24 @@ class PresetsDetailedDialog {
7677 this . _showCliText ( false ) ;
7778 }
7879
80+ _loadDescription ( ) {
81+ let text = this . _preset . description ?. join ( "\n" ) ;
82+
83+ switch ( this . _preset . parser ) {
84+ case "MARKED" :
85+ this . _isDescriptionHtml = true ;
86+ text = marked . parse ( text ) ;
87+ text = DOMPurify . sanitize ( text ) ;
88+ this . _domDescriptionHtml . html ( text ) ;
89+ GUI . addLinksTargetBlank ( this . _domDescriptionHtml ) ;
90+ break ;
91+ default :
92+ this . _isDescriptionHtml = false ;
93+ this . _domDescriptionText . text ( text ) ;
94+ break ;
95+ }
96+ }
97+
7998 _updateFinalCliText ( ) {
8099 this . _domCliText . text ( this . _getFinalCliText ( ) . join ( "\n" ) ) ;
81100 }
@@ -107,7 +126,8 @@ class PresetsDetailedDialog {
107126 this . _domError = $ ( '#presets_detailed_dialog_error' ) ;
108127 this . _domProperties = $ ( '#presets_detailed_dialog_properties' ) ;
109128 this . _titlePanel = $ ( '.preset_detailed_dialog_title_panel' ) ;
110- this . _domDescription = $ ( '#presets_detailed_dialog_text_description' ) ;
129+ this . _domDescriptionText = $ ( '#presets_detailed_dialog_text_description' ) ;
130+ this . _domDescriptionHtml = $ ( '#presets_detailed_dialog_html_description' ) ;
111131 this . _domCliText = $ ( '#presets_detailed_dialog_text_cli' ) ;
112132 this . _domGitHubLink = this . _domDialog . find ( '#presets_open_online' ) ;
113133 this . _domDiscussionLink = this . _domDialog . find ( '#presets_open_discussion' ) ;
@@ -118,7 +138,8 @@ class PresetsDetailedDialog {
118138 }
119139
120140 _showCliText ( value ) {
121- this . _domDescription . toggle ( ! value ) ;
141+ this . _domDescriptionText . toggle ( ! value && ! this . _isDescriptionHtml ) ;
142+ this . _domDescriptionHtml . toggle ( ! value && this . _isDescriptionHtml ) ;
122143 this . _domCliText . toggle ( value ) ;
123144 this . _domButtonCliShow . toggle ( ! value ) ;
124145 this . _domButtonCliHide . toggle ( value ) ;
0 commit comments