mirror of
https://github.com/ralsina/tartrazine.git
synced 2025-05-23 08:30:07 -03:00
check for empty content in getHeaderAndFooter function
Signed-off-by: Manuel Carmona <manu.carmona90@gmail.com>
This commit is contained in:
parent
8ddce8bc4b
commit
5dad184af0
@ -158,6 +158,11 @@ var modelinesFunc = []Strategy{
|
|||||||
|
|
||||||
func getHeaderAndFooter(content []byte) []byte {
|
func getHeaderAndFooter(content []byte) []byte {
|
||||||
const searchScope = 5
|
const searchScope = 5
|
||||||
|
|
||||||
|
if len(content) == 0 {
|
||||||
|
return content
|
||||||
|
}
|
||||||
|
|
||||||
if bytes.Count(content, []byte("\n")) < 2*searchScope {
|
if bytes.Count(content, []byte("\n")) < 2*searchScope {
|
||||||
return content
|
return content
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user