Merge pull request #24 from xddxdd/lantian-dev
frontend: allow long lines if result is short
This commit is contained in:
commit
80d9351a58
@ -64,7 +64,6 @@ func shortenWhoisFilter(whois string) string {
|
|||||||
|
|
||||||
shouldSkip := false
|
shouldSkip := false
|
||||||
shouldSkip = shouldSkip || len(s) == 0
|
shouldSkip = shouldSkip || len(s) == 0
|
||||||
shouldSkip = shouldSkip || len(s) > 80
|
|
||||||
shouldSkip = shouldSkip || len(s) > 0 && s[0] == '#'
|
shouldSkip = shouldSkip || len(s) > 0 && s[0] == '#'
|
||||||
|
|
||||||
if shouldSkip {
|
if shouldSkip {
|
||||||
@ -75,6 +74,7 @@ func shortenWhoisFilter(whois string) string {
|
|||||||
commandResultLonger += s + "\n"
|
commandResultLonger += s + "\n"
|
||||||
linesLonger++
|
linesLonger++
|
||||||
|
|
||||||
|
shouldSkip = shouldSkip || len(s) > 80
|
||||||
shouldSkip = shouldSkip || !strings.Contains(s, ":")
|
shouldSkip = shouldSkip || !strings.Contains(s, ":")
|
||||||
shouldSkip = shouldSkip || strings.Index(s, ":") > 20
|
shouldSkip = shouldSkip || strings.Index(s, ":") > 20
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ func shortenWhoisFilter(whois string) string {
|
|||||||
lines++
|
lines++
|
||||||
}
|
}
|
||||||
|
|
||||||
if lines < 10 {
|
if lines < 5 {
|
||||||
commandResult = commandResultLonger
|
commandResult = commandResultLonger
|
||||||
skippedLines = skippedLinesLonger
|
skippedLines = skippedLinesLonger
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user