Skip to content

Commit 1d69cb8

Browse files
committed
handled specific case
1 parent 3a76802 commit 1d69cb8

File tree

1 file changed

+6
-1
lines changed
  • compiler-rs/clients_schema_to_openapi/src

1 file changed

+6
-1
lines changed

compiler-rs/clients_schema_to_openapi/src/paths.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ fn get_path_parameters(template: &str) -> Vec<&str> {
320320
fn split_summary_desc(desc: &str) -> SplitDesc{
321321
let segmenter = SentenceSegmenter::new();
322322

323-
let desc_no_newlines = desc.replace('\n'," ");
323+
let desc_no_newlines = desc.replace("\n\n",".\n").replace('\n'," ");
324324

325325
let breakpoints: Vec<usize> = segmenter
326326
.segment_str(&desc_no_newlines)
@@ -379,6 +379,11 @@ mod tests {
379379
summary: Some(String::from("These are two totally")),
380380
description: Some(String::from("Separate sentences!"))
381381
});
382+
assert_eq!(split_summary_desc("Such a weird way to separate sentences\n\nRight?"),
383+
SplitDesc{
384+
summary: Some(String::from("Such a weird way to separate sentences")),
385+
description: Some(String::from("Right?"))
386+
});
382387
assert_eq!(split_summary_desc(""),
383388
SplitDesc{
384389
summary: None,

0 commit comments

Comments
 (0)