Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make chomp return the type it receives #2187

Closed
bep opened this issue Jun 6, 2016 · 8 comments · Fixed by #3968
Closed

Make chomp return the type it receives #2187

bep opened this issue Jun 6, 2016 · 8 comments · Fixed by #3968

Comments

@bep
Copy link
Member

bep commented Jun 6, 2016

See https://discuss.gohugo.io/t/errors-with-type-template-html-should-be-string-with-hugo-0-16-0/3470/3

@bep
Copy link
Member Author

bep commented Jun 6, 2016

See golang/go#15974

@bep
Copy link
Member Author

bep commented Feb 28, 2017

This issue has been automatically marked as stale because it has not been commented on for at least four months.

The resources of the Hugo team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, and you feel that it is still valuable, please open a proposal at https://discuss.gohugo.io/.

This issue will automatically be closed in four months if no further activity occurs. Thank you for all your contributions.

@bep bep added the Stale label Feb 28, 2017
@bep
Copy link
Member Author

bep commented Mar 1, 2017

Note/Update: This issue is marked as stale, and I may have said something earlier about "opening a thread on the discussion forum". Please don't.

If this is a bug and you can still reproduce this error on the latest release or the master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.

@moorereason
Copy link
Contributor

The core issue remains: chomp returns a template.HTML type which index doesn't support as an index.

We've forked the index function from stdlib. We ought to be able to fix this ourselves.

@bep
Copy link
Member Author

bep commented Sep 28, 2017

@moorereason what is the proper fix for this?

  1. Make chomp return a string?
  2. Make index support HTML?

@moorereason
Copy link
Contributor

moorereason commented Sep 28, 2017

@bep,
chomp could return template.HTML if that's the type you sent it or return a string, otherwise.

Regardless of what I said in March, I don't think there's much need for index to support template.HTML.

@bep
Copy link
Member Author

bep commented Sep 28, 2017

chomp could return template.HTML if that's the type you sent it or return a string, otherwise.

Yes, that sounds about right.

@bep bep changed the title Fix chomp vs index Make chomp return the type it receives Sep 28, 2017
kropp added a commit to kropp/hugo that referenced this issue Oct 13, 2017
kropp added a commit to kropp/hugo that referenced this issue Oct 14, 2017
@bep bep closed this as completed in #3968 Dec 16, 2017
bep pushed a commit that referenced this issue Dec 16, 2017
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants