We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 833a202 commit 750c09fCopy full SHA for 750c09f
language/lexer/lexer.go
@@ -404,25 +404,13 @@ func blockStringValue(in string) string {
404
}
405
406
// Remove leading blank lines.
407
- for {
408
- if isBlank := lineIsBlank(lines[0]); !isBlank {
409
- break
410
- }
411
- if len(lines) == 1 {
412
413
+ for len(lines) > 0 && lineIsBlank(lines[0]) {
414
lines = lines[1:]
415
416
417
// Remove trailing blank lines.
418
+ for len(lines) > 0 && lineIsBlank(lines[len(lines)-1]) {
419
i := len(lines) - 1
420
- if isBlank := lineIsBlank(lines[i]); !isBlank {
421
422
423
424
425
426
lines = append(lines[:i], lines[i+1:]...)
427
428
0 commit comments