| 1 | [](https://pkg.go.dev/code.forgejo.org/forgejo/reply) |
| 2 | [](https://goreportcard.com/report/code.forgejo.org/forgejo/reply) |
| 3 | |
| 4 | # reply |
| 5 | |
| 6 | Library to trim replies from plain text email. (Golang port of https://github.com/discourse/email_reply_trimmer) |
| 7 | |
| 8 | Forked from https://github.com/dimiro1/reply |
| 9 | |
| 10 | ## Why |
| 11 | |
| 12 | Reply was forked because the original project does not seem to be maintained. |
| 13 | Furthermore, the version before the fork removes parts of the mail that should not be removed. |
| 14 | The project was forked to change this. |
| 15 | |
| 16 | # Usage |
| 17 | |
| 18 | ```go |
| 19 | package main |
| 20 | |
| 21 | import ( |
| 22 | "fmt" |
| 23 | |
| 24 | "code.forgejo.org/forgejo/reply" |
| 25 | ) |
| 26 | |
| 27 | func main() { |
| 28 | message := ` |
| 29 | This is before the embedded email. |
| 30 | |
| 31 | On Wed, Sep 25, 2013, at 03:57 PM, richard_clark wrote: |
| 32 | |
| 33 | Richard> This is the embedded email |
| 34 | |
| 35 | This is after the embedded email and will not show up because 99% of the times |
| 36 | this is the signature... |
| 37 | ` |
| 38 | fmt.Println(reply.FromText(message)) |
| 39 | } |
| 40 | ``` |
| 41 | |
| 42 | will output: |
| 43 | |
| 44 | ```text |
| 45 | This is before the embedded email. |
| 46 | ``` |