Quote is an excerpt from somewhere else.
Quote ::= QuoteLine+
QuoteLine ::= ">" QuoteLineContent (NL | EOD)
Algorithm
After initial parsing, we end up with a collection of QuoteLineContents. This is not we need. We gotta convert it like that:
function QuoteLinesFinalized(lines []string) []string {
# Find the common space prefix length
prefixlen := 0
for line in lines {
curlen := 0
for char in line {
if char == " " {
curlen++
} else {
break
}
}
prefixlen := min(prefixlen, curlen)
}
# Remove the common space prefix
result := []string{}
for line in lines {
result << line[prefixlen:]
}
result
}