@@ -276,6 +276,16 @@ class HtmlSaveOptionsData extends SaveOptionsData {
276
276
set prettyFormat (bool ? val) => _prettyFormat = val;
277
277
278
278
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
+
279
289
/// Gets or sets the flag that indicates whether backslash characters should be replaced with yen signs.
280
290
/// Default value is false.
281
291
/// 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 {
667
677
prettyFormat = null ;
668
678
}
669
679
680
+ if (json.containsKey ('RemoveJavaScriptFromLinks' )) {
681
+ removeJavaScriptFromLinks = json['RemoveJavaScriptFromLinks' ] as bool ;
682
+ } else {
683
+ removeJavaScriptFromLinks = null ;
684
+ }
685
+
670
686
if (json.containsKey ('ReplaceBackslashWithYenSign' )) {
671
687
replaceBackslashWithYenSign = json['ReplaceBackslashWithYenSign' ] as bool ;
672
688
} else {
@@ -882,6 +898,10 @@ class HtmlSaveOptionsData extends SaveOptionsData {
882
898
_result['PrettyFormat' ] = prettyFormat! ;
883
899
}
884
900
901
+ if (removeJavaScriptFromLinks != null ) {
902
+ _result['RemoveJavaScriptFromLinks' ] = removeJavaScriptFromLinks! ;
903
+ }
904
+
885
905
if (replaceBackslashWithYenSign != null ) {
886
906
_result['ReplaceBackslashWithYenSign' ] = replaceBackslashWithYenSign! ;
887
907
}
0 commit comments