@@ -276,6 +276,16 @@ class HtmlSaveOptionsData extends SaveOptionsData {
276276 set prettyFormat (bool ? val) => _prettyFormat = val;
277277
278278
279+ /// Gets or sets the flag that indicates whether JavaScript will be removed from links.
280+ /// Default is false.
281+ /// If this option is enabled, all links containing JavaScript (e.g., links with "javascript:" in the href attribute)
282+ /// will be replaced with "javascript:void(0)". This can help prevent potential security risks, such as XSS attacks.
283+ bool ? _removeJavaScriptFromLinks;
284+
285+ bool ? get removeJavaScriptFromLinks => _removeJavaScriptFromLinks;
286+ set removeJavaScriptFromLinks (bool ? val) => _removeJavaScriptFromLinks = val;
287+
288+
279289 /// Gets or sets the flag that indicates whether backslash characters should be replaced with yen signs.
280290 /// Default value is false.
281291 /// By default, Aspose.Words mimics MS Word's behavior and doesn't replace backslash characters with yen signs in
@@ -667,6 +677,12 @@ class HtmlSaveOptionsData extends SaveOptionsData {
667677 prettyFormat = null ;
668678 }
669679
680+ if (json.containsKey ('RemoveJavaScriptFromLinks' )) {
681+ removeJavaScriptFromLinks = json['RemoveJavaScriptFromLinks' ] as bool ;
682+ } else {
683+ removeJavaScriptFromLinks = null ;
684+ }
685+
670686 if (json.containsKey ('ReplaceBackslashWithYenSign' )) {
671687 replaceBackslashWithYenSign = json['ReplaceBackslashWithYenSign' ] as bool ;
672688 } else {
@@ -882,6 +898,10 @@ class HtmlSaveOptionsData extends SaveOptionsData {
882898 _result['PrettyFormat' ] = prettyFormat! ;
883899 }
884900
901+ if (removeJavaScriptFromLinks != null ) {
902+ _result['RemoveJavaScriptFromLinks' ] = removeJavaScriptFromLinks! ;
903+ }
904+
885905 if (replaceBackslashWithYenSign != null ) {
886906 _result['ReplaceBackslashWithYenSign' ] = replaceBackslashWithYenSign! ;
887907 }
0 commit comments