diff options
author | 2021-07-26 20:25:54 +0200 | |
---|---|---|
committer | 2021-07-26 20:25:54 +0200 | |
commit | ad0e26dc04008feec8de0603c88fbd63f87c18ec (patch) | |
tree | fb8402a9d881b6480eba0a2402f05f7b39f7435c /internal/api/model/status.go | |
parent | add trusted proxy for parsing client IPs (#115) (diff) | |
download | gotosocial-ad0e26dc04008feec8de0603c88fbd63f87c18ec.tar.xz |
Markdown Statuses (#116)
* parse markdown statuses if desired
* add some preliminary docs for writing posts
Diffstat (limited to 'internal/api/model/status.go')
-rw-r--r-- | internal/api/model/status.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/internal/api/model/status.go b/internal/api/model/status.go index 963ef4f86..ef96568c4 100644 --- a/internal/api/model/status.go +++ b/internal/api/model/status.go @@ -103,6 +103,9 @@ type StatusCreateRequest struct { ScheduledAt string `form:"scheduled_at" json:"scheduled_at" xml:"scheduled_at"` // ISO 639 language code for this status. Language string `form:"language" json:"language" xml:"language"` + // Format in which to parse the submitted status. + // Can be either plain or markdown. Empty will default to plain. + Format StatusFormat `form:"format" json:"format" xml:"format"` } // Visibility denotes the visibility of this status to other users @@ -140,3 +143,15 @@ type AdvancedVisibilityFlagsForm struct { // This status can be liked/faved Likeable *bool `form:"likeable" json:"likeable" xml:"likeable"` } + +// StatusFormat determines what kind of format a submitted status should be parsed in +type StatusFormat string + +// StatusFormatPlain expects a plaintext status which will then be formatted into html. +const StatusFormatPlain StatusFormat = "plain" + +// StatusFormatMarkdown expects a markdown formatted status, which will then be formatted into html. +const StatusFormatMarkdown StatusFormat = "markdown" + +// StatusFormatDefault is the format that should be used when nothing else is specified. +const StatusFormatDefault StatusFormat = StatusFormatPlain |