Skip to content

Commit

Permalink
Don't strip .SH unnecessarily in util::get_section
Browse files Browse the repository at this point in the history
  • Loading branch information
ysthakur committed Aug 18, 2023
1 parent 03c8e2f commit cde586a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/parse/type3.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use log::debug;
use regex::{Regex, RegexBuilder};
use regex::RegexBuilder;

use super::{util, Flag};

Expand Down
6 changes: 2 additions & 4 deletions src/parse/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@ pub fn get_section(title: &str, text: &str) -> Option<String> {
.dot_matches_new_line(true)
.build()
.unwrap();
re.captures(text).map(|captures| {
let content = captures.get(1).unwrap().as_str();
content.strip_suffix(".SH").unwrap_or(content).to_string()
})
re.captures(text)
.map(|captures| captures.get(1).unwrap().as_str().to_string())
}

/// Copied more or less directly from Fish's `remove_groff_formatting`
Expand Down

0 comments on commit cde586a

Please sign in to comment.