mirror of
https://github.com/writefreely/writefreely
synced 2024-11-10 11:24:13 +00:00
Truncate lede at question mark
This fixes TestPostLede and closes #316.
This commit is contained in:
parent
ac90cb2c80
commit
98d88b9a4b
1 changed files with 6 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright © 2018 A Bunch Tell LLC.
|
||||
* Copyright © 2018-2020 A Bunch Tell LLC.
|
||||
*
|
||||
* This file is part of WriteFreely.
|
||||
*
|
||||
|
@ -57,6 +57,11 @@ func PostLede(t string, includePunc bool) string {
|
|||
c := []rune(t)
|
||||
t = string(c[:punc+iAdj])
|
||||
}
|
||||
punc = stringmanip.IndexRune(t, '?')
|
||||
if punc > -1 {
|
||||
c := []rune(t)
|
||||
t = string(c[:punc+iAdj])
|
||||
}
|
||||
|
||||
return t
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue