Skip to content

Commit

Permalink
Remove rest of the now unused emoji code
Browse files Browse the repository at this point in the history
See #11598
  • Loading branch information
bep committed Oct 26, 2023
1 parent 272484f commit c4a530f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 31 deletions.
5 changes: 0 additions & 5 deletions hugolib/page.go
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,6 @@ func (p *pageState) wrapError(err error) error {
}

return herrors.NewFileErrorFromFile(err, filename, p.s.SourceSpec.Fs.Source, lineMatcher)

}

func (p *pageState) getContentConverter() converter.Converter {
Expand Down Expand Up @@ -674,7 +673,6 @@ func (p *pageState) mapContentForResult(
markup string,
withFrontMatter func(map[string]any) error,
) error {

iter := result.Iterator()

fail := func(err error, i pageparser.Item) error {
Expand Down Expand Up @@ -792,9 +790,6 @@ Loop:
s.shortcodes = append(s.shortcodes, currShortcode)

rn.AddShortcode(currShortcode)

case it.Type == pageparser.TypeEmoji:
rn.AddBytes(it)
case it.IsEOF():
break Loop
case it.IsError():
Expand Down
14 changes: 5 additions & 9 deletions hugolib/shortcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package hugolib
import (
"bytes"
"context"
"errors"
"fmt"
"html/template"
"path"
Expand All @@ -26,8 +27,6 @@ import (
"strings"
"sync"

"errors"

"github.com/gohugoio/hugo/common/herrors"

"github.com/gohugoio/hugo/parser/pageparser"
Expand Down Expand Up @@ -312,8 +311,8 @@ func prepareShortcode(
tplVariants tpl.TemplateVariants,
sc *shortcode,
parent *ShortcodeWithPage,
p *pageState) (shortcodeRenderer, error) {

p *pageState,
) (shortcodeRenderer, error) {
toParseErr := func(err error) error {
return p.parseError(fmt.Errorf("failed to render shortcode %q: %w", sc.name, err), p.source.parsed.Input(), sc.pos)
}
Expand All @@ -332,7 +331,6 @@ func prepareShortcode(
}

return fn, nil

}

func doRenderShortcode(
Expand All @@ -342,7 +340,8 @@ func doRenderShortcode(
tplVariants tpl.TemplateVariants,
sc *shortcode,
parent *ShortcodeWithPage,
p *pageState) (shortcodeRenderer, error) {
p *pageState,
) (shortcodeRenderer, error) {
var tmpl tpl.Template

// Tracks whether this shortcode or any of its children has template variations
Expand Down Expand Up @@ -501,7 +500,6 @@ func (s *shortcodeHandler) transferNames(in *shortcodeHandler) {
for k := range in.nameSet {
s.nameSet[k] = true
}

}

func (s *shortcodeHandler) hasName(name string) bool {
Expand Down Expand Up @@ -629,8 +627,6 @@ Loop:
return sc, nil
case currItem.IsText():
sc.inner = append(sc.inner, currItem.ValStr(source))
case currItem.Type == pageparser.TypeEmoji:
sc.inner = append(sc.inner, currItem.ValStr(source))
case currItem.IsShortcodeName():

sc.name = currItem.ValStr(source)
Expand Down
1 change: 0 additions & 1 deletion parser/pageparser/item.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ const (
TypeFrontMatterTOML
TypeFrontMatterJSON
TypeFrontMatterORG
TypeEmoji
TypeIgnore // // The BOM Unicode byte order marker and possibly others

// shortcode items
Expand Down
31 changes: 15 additions & 16 deletions parser/pageparser/itemtype_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c4a530f

Please sign in to comment.