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

truncate doesn't handle formatted HTML very well #10399

Closed
bep opened this issue Oct 27, 2022 · 2 comments
Closed

truncate doesn't handle formatted HTML very well #10399

bep opened this issue Oct 27, 2022 · 2 comments

Comments

@bep
Copy link
Member

bep commented Oct 27, 2022

E.g.:

<a
  href="https://gohugo.io/content-management/front-matter/"  
    target="_blank"  
  >Front matter</a
>
@bep bep added the Bug label Oct 27, 2022
@bep bep modified the milestones: v0.105.0, v0.106.0 Oct 27, 2022
@bep bep modified the milestones: v0.106.0, v0.107.0 Nov 18, 2022
@bep bep modified the milestones: v0.107.0, v0.108.0 Dec 3, 2022
@bep bep modified the milestones: v0.108.0, v0.109.0 Dec 14, 2022
@bep bep modified the milestones: v0.109.0, v0.111.0, v0.110.0 Jan 26, 2023
khayyamsaleem added a commit to khayyamsaleem/hugo that referenced this issue Jan 27, 2023
Before this fix, strings.Truncate would erroneously re-include
attributes from the opening tag in the closing tag when closing
formatted html, due to a bug in how tagnames were extracted from the
regex capture group for html tags used in `truncate.go`. This change
ensures that only the tagname is retained and all attributes are discarded
when storing the tags for closing them later.

Fixes gohugoio#10399
@khayyamsaleem
Copy link
Contributor

requesting assignment 🖐🏽

@bep bep modified the milestones: v0.111.0, v0.112.0 Feb 15, 2023
@bep bep closed this as completed in c0d15a2 Mar 1, 2023
@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 23, 2023
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