This commit is contained in:
2023-12-29 05:37:58 +00:00
parent 6d41efa243
commit 96ccd5c639
2 changed files with 37 additions and 29 deletions

View File

@@ -817,10 +817,13 @@ function replaceHeaders(text::T, headers, step::Int) where {T<:AbstractString}
header = i[1:end-1] # not include ":"
if occursin(header, newtext)
startind = findfirst(header, newtext)[1]
stopind = findnext(":", newtext, startind+1)[end] #BUG MethodError: no method matching lastindex(::Nothing)
stopind = findnext(":", newtext, startind+1)[end]
word = newtext[startind: stopind]
newword = "$header $step:"
newtext = replace(newtext, word=> newword)
if header == "Thought:"
error(1)
end
end
end