summaryrefslogtreecommitdiff
path: root/gemini/gemtext/types.go
diff options
context:
space:
mode:
Diffstat (limited to 'gemini/gemtext/types.go')
-rw-r--r--gemini/gemtext/types.go24
1 files changed, 3 insertions, 21 deletions
diff --git a/gemini/gemtext/types.go b/gemini/gemtext/types.go
index 3965b11..71f3242 100644
--- a/gemini/gemtext/types.go
+++ b/gemini/gemtext/types.go
@@ -20,7 +20,7 @@ const (
//
// =:[<ws>]<url>[<ws><label>][\r]\n
//
- // The line is a PromptLine.
+ // The line is a LinkLine.
LineTypePrompt
// LineTypePreformatToggle switches the document between pre-formatted text or not.
@@ -104,9 +104,10 @@ type LinkLine struct {
raw []byte
url []byte
label []byte
+ typ LineType
}
-func (ll LinkLine) Type() LineType { return LineTypeLink }
+func (ll LinkLine) Type() LineType { return ll.typ }
func (ll LinkLine) Raw() []byte { return ll.raw }
func (ll LinkLine) String() string { return string(ll.raw) }
@@ -118,25 +119,6 @@ func (ll LinkLine) URL() string { return string(ll.url) }
// Label returns the label portion of the line.
func (ll LinkLine) Label() string { return string(ll.label) }
-// PromptLine is a Spartan =: prompt line.
-type PromptLine struct {
- raw []byte
- url []byte
- label []byte
-}
-
-func (pl PromptLine) Type() LineType { return LineTypePrompt }
-func (pl PromptLine) Raw() []byte { return pl.raw }
-func (pl PromptLine) String() string { return string(pl.raw) }
-
-// URL returns the original url portion of the line.
-//
-// It is not guaranteed to be a valid URL.
-func (pl PromptLine) URL() string { return string(pl.url) }
-
-// Label retrns the label portion of the line.
-func (pl PromptLine) Label() string { return string(pl.label) }
-
// PreformatToggleLine is a preformatted text toggle line.
type PreformatToggleLine struct {
raw []byte