diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-10-17 13:48:55 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-10-22 19:57:43 +0200 |
commit | 2fdc4a24d5450a98cf38a4456e8e0e8e97a3343d (patch) | |
tree | 409814d04e5b6454abd56a230894bd0e78e3cfb5 /parser/pageparser/item.go | |
parent | f6863e1ef725f654a4c869ef4955f9add6908a46 (diff) |
parser/pageparser: Add front matter etc. support
See #5324
Diffstat (limited to 'parser/pageparser/item.go')
-rw-r--r-- | parser/pageparser/item.go | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/parser/pageparser/item.go b/parser/pageparser/item.go index ae2f6cbc9..f7495c90e 100644 --- a/parser/pageparser/item.go +++ b/parser/pageparser/item.go @@ -73,10 +73,10 @@ func (i Item) String() string { return i.Val case i.typ > tKeywordMarker: return fmt.Sprintf("<%s>", i.Val) - case len(i.Val) > 20: - return fmt.Sprintf("%.20q...", i.Val) + case len(i.Val) > 50: + return fmt.Sprintf("%v:%.20q...", i.typ, i.Val) } - return fmt.Sprintf("[%s]", i.Val) + return fmt.Sprintf("%v:[%s]", i.typ, i.Val) } type itemType int @@ -85,6 +85,15 @@ const ( tError itemType = iota tEOF + // page items + tHTMLLead // < + tSummaryDivider // <!--more--> + tSummaryDividerOrg // # more + tFrontMatterYAML + tFrontMatterTOML + tFrontMatterJSON + tFrontMatterORG + // shortcode items tLeftDelimScNoMarkup tRightDelimScNoMarkup @@ -95,8 +104,7 @@ const ( tScParam tScParamVal - //itemIdentifier - tText // plain text, used for everything outside the shortcodes + tText // plain text // preserved for later - keywords come after this tKeywordMarker |