@@ -42,10 +42,21 @@ macro_rules! configure_methods {
42
42
///
43
43
/// Changing this option automatically changes the [`trim_text_end`] option.
44
44
///
45
- /// (`false` by default)
45
+ /// (`false` by default).
46
+ ///
47
+ /// <div style="background:rgba(80, 240, 100, 0.20);padding:0.75em;">
48
+ ///
49
+ /// WARNING: With this option every text events will be trimmed which is
50
+ /// incorrect behavior when text events delimited by comments, processing
51
+ /// instructions or CDATA sections. To correctly trim data manually apply
52
+ /// [`BytesText::inplace_trim_start`] and [`BytesText::inplace_trim_end`]
53
+ /// only to necessary events.
54
+ /// </div>
46
55
///
47
56
/// [`Text`]: Event::Text
48
57
/// [`trim_text_end`]: Self::trim_text_end
58
+ /// [`BytesText::inplace_trim_start`]: crate::events::BytesText::inplace_trim_start
59
+ /// [`BytesText::inplace_trim_end`]: crate::events::BytesText::inplace_trim_end
49
60
pub fn trim_text( & mut self , val: bool ) -> & mut Self {
50
61
self $( . $holder) ? . parser. trim_text_start = val;
51
62
self $( . $holder) ? . parser. trim_text_end = val;
@@ -57,9 +68,20 @@ macro_rules! configure_methods {
57
68
/// When set to `true`, trailing whitespace is trimmed in [`Text`] events.
58
69
/// If after that the event is empty it will not be pushed.
59
70
///
60
- /// (`false` by default)
71
+ /// (`false` by default).
72
+ ///
73
+ /// <div style="background:rgba(80, 240, 100, 0.20);padding:0.75em;">
74
+ ///
75
+ /// WARNING: With this option every text events will be trimmed which is
76
+ /// incorrect behavior when text events delimited by comments, processing
77
+ /// instructions or CDATA sections. To correctly trim data manually apply
78
+ /// [`BytesText::inplace_trim_start`] and [`BytesText::inplace_trim_end`]
79
+ /// only to necessary events.
80
+ /// </div>
61
81
///
62
82
/// [`Text`]: Event::Text
83
+ /// [`BytesText::inplace_trim_start`]: crate::events::BytesText::inplace_trim_start
84
+ /// [`BytesText::inplace_trim_end`]: crate::events::BytesText::inplace_trim_end
63
85
pub fn trim_text_end( & mut self , val: bool ) -> & mut Self {
64
86
self $( . $holder) ? . parser. trim_text_end = val;
65
87
self
0 commit comments