File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -210,6 +210,8 @@ fn apply_tldr(input: &str) -> String {
210210 let tldr_section_re = Regex :: new ( r"(?i)^\s*#+\s*license\b|^\s*#+\s*version(s)?\b|^\s*#+license\b|^\s*#+version(s)?\b" ) . unwrap ( ) ;
211211 // Match any heading (for ending the skip)
212212 let heading_re = Regex :: new ( r"^\s*#+" ) . unwrap ( ) ;
213+ // Match <detail> tags including start, end, and inline attributes
214+ let detail_tag_re = Regex :: new ( r"<[/]?detail.*?>" ) . unwrap ( ) ;
213215
214216 for line in input. lines ( ) {
215217 // Start skipping if we hit a LICENSE or VERSION(S) heading
@@ -222,10 +224,12 @@ fn apply_tldr(input: &str) -> String {
222224 skip = false ;
223225 }
224226 if !skip {
225- output. push ( line) ;
227+ // Remove <detail> tags from the line
228+ let cleaned_line = detail_tag_re. replace_all ( line, "" ) . to_string ( ) ;
229+ output. push ( cleaned_line. to_string ( ) ) ;
226230 }
227231 }
228- output. join ( "\n " )
232+ output. iter ( ) . map ( |s| s . as_str ( ) ) . collect :: < Vec < _ > > ( ) . join ( "\n " )
229233}
230234
231235/// Configuration for the test tool
@@ -594,3 +598,4 @@ Another version section.
594598 assert ! ( output. contains( "Some real documentation here." ) ) ;
595599}
596600}
601+
You can’t perform that action at this time.
0 commit comments