Skip to content

Commit

Permalink
MarkupEntity redesign
Browse files Browse the repository at this point in the history
  • Loading branch information
sdfsdhgjkbmnmxc committed Oct 23, 2020
1 parent f66484c commit 98d2492
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions markup_entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,31 @@ const (
// Markup entity. Experimental
type MarkupEntity struct {
// Open marker offset
Open int `json:"open"`
Open int `json:"op"`

// Open marker length
OpenLength int `json:"open_length,omitempty"`
OpenLength int `json:"oplen,omitempty"`

// Close marker offset
Close int `json:"close"`
Close int `json:"cl"`

// Close marker length
CloseLength int `json:"close_length,omitempty"`
CloseLength int `json:"cllen,omitempty"`

// Marker type
Type string `json:"type"`
Type string `json:"typ"`

// Url, for Link type
Url string `json:"url,omitempty"`

// Text replacement.
Repl string `json:"repl,omitempty"`

// Time, for Time type
Time *time.Time `json:"time,omitempty"`

// List of internal markup entities
Entities []MarkupEntity `json:"entities,omitempty"`
Childs []MarkupEntity `json:"childs,omitempty"`
}

func (e MarkupEntity) String() string {
Expand Down

0 comments on commit 98d2492

Please sign in to comment.