diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9fd45e0..488e737 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -2,21 +2,20 @@ name: Rust on: push: - branches: [ "main" ] + branches: ["main"] pull_request: - branches: [ "main" ] + branches: ["main"] env: CARGO_TERM_COLOR: always jobs: build: - runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Build - run: cargo build --verbose - - name: Run tests - run: cargo test --verbose + - uses: actions/checkout@v4 + - name: Build + run: cargo build --verbose + - name: Run tests + run: cargo test --verbose diff --git a/src/tools/tldr.rs b/src/tools/tldr.rs index 452c778..ade083f 100644 --- a/src/tools/tldr.rs +++ b/src/tools/tldr.rs @@ -14,12 +14,12 @@ pub fn apply_tldr(input: &str) -> String { let detail_tag_re = Regex::new(r"<[/]?detail.*?>").unwrap(); for line in input.lines() { - // Start skipping if we hit a LICENSE or VERSION(S) heading - if !skip && tldr_section_re.is_match(line) { + // Check if this is a LICENSE or VERSION(S) heading + if tldr_section_re.is_match(line) { skip = true; continue; // skip the heading line itself } - // Stop skipping at the next heading (but do not skip the heading itself) + // Stop skipping at the next heading (that's not LICENSE/VERSION) if skip && heading_re.is_match(line) { skip = false; }