This repository was archived by the owner on Jan 2, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -200,7 +200,7 @@ fn sanitize(article: &str) -> String {
200200 let sanitized = xml_for_each ( article, |code| Some ( fixup_xml_code ( code) . into_owned ( ) ) ) ;
201201 regex ! ( "<!--.*?-->" )
202202 . replace_all ( & sanitized, "" )
203- . into_owned ( )
203+ . replace ( " \n \n [^summary]: \n " , " \n \n [^summary]: " )
204204}
205205
206206fn fixup_xml_code ( xml : & str ) -> Cow < str > {
@@ -1257,4 +1257,23 @@ func sendSlackMessage(org string) error {
12571257 assert_eq ! ( expected_body, body) ;
12581258 assert_eq ! ( expected_conclusion, conclusion. unwrap( ) ) ;
12591259 }
1260+
1261+ #[ test]
1262+ fn test_malformed_summary ( ) {
1263+ let input = "Foo bar.
1264+
1265+ [^summary]:
1266+ Baz quux." ;
1267+
1268+ let ( body, conclusion) = decode ( input) ;
1269+
1270+ let arena = comrak:: Arena :: new ( ) ;
1271+ let mut options = comrak:: ComrakOptions :: default ( ) ;
1272+ options. extension . footnotes = true ;
1273+
1274+ dbg ! ( comrak:: parse_document( & arena, input, & options) ) ;
1275+
1276+ assert_eq ! ( "Foo bar." , body) ;
1277+ assert_eq ! ( "Baz quux." , conclusion. unwrap( ) ) ;
1278+ }
12601279}
You can’t perform that action at this time.
0 commit comments