Skip to content

Commit e9fa402

Browse files
committed
fix: handle multiline bodies properly
1 parent e314d5b commit e9fa402

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

source/rules/footer-leading-blank.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,16 @@ export default (parsed, when) => {
66

77
const negated = when === 'never';
88

9-
// get complete body split into lines
10-
const lines = (parsed.raw || '').split(/\r|\n/).slice(2);
9+
const count = (parsed.body || '').split(/\r|\n/).length;
10+
11+
// get complete message split into lines
12+
const lines = (parsed.raw || '')
13+
.split(/\r|\n/)
14+
.slice(count + 1);
15+
1116
const [leading] = lines;
1217

13-
// check if the first line of body is empty
18+
// check if the first line of footer is empty
1419
const succeeds = leading === '';
1520

1621
return [

0 commit comments

Comments
 (0)