Skip to content

Conversation

@mg6-hanabi
Copy link
Contributor

See for example https://hanab.live/tags/James
Click "ilikeeelst ,James ,Slacking ,str8tsknacker" link
Error: The player of " ilikeeelst " does not exist in the database.

@Zamiell
Copy link
Collaborator

Zamiell commented Aug 14, 2025

did u test it

@mg6-hanabi
Copy link
Contributor Author

No, this commit only removes whitespaces from the template, reverting relevant part to the state from 3 years ago. There is no structural change to the template file.
b00c4e9#diff-20faac782cca83c5da49bd3583a36e43258e9bc6bfb2883cd4b823b7f170b48fL68-L69 these lines were reformatted, which caused the issue.
Would probably be good to update max line width settings of the prettier check before merging this fix.

@Zamiell
Copy link
Collaborator

Zamiell commented Aug 14, 2025

can you make it pass CI and also test it

@mg6-hanabi
Copy link
Contributor Author

To make CI pass requires a systemic change outside the scope of this fix.
Depending on granulatiry of settings of Prettier and the behaviour of this specific tool (which I'm not familiar with and thus currently unable to provide assistance) after changing max line width to a higher value that would not fail the check with this fix included, it is not unreasonable to assume majority of code would be impacted, so I don't think I'm in position to make decisions on such a change.

@Zamiell
Copy link
Collaborator

Zamiell commented Aug 14, 2025

so you are saying that prettier makes the link not work? why does adding whitespace break the link?

@mg6-hanabi
Copy link
Contributor Author

mg6-hanabi commented Aug 14, 2025

The use of Prettier in go templates have broken these links, yes.
Currently the links look like this: https://hanab.live/history/%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ilikeeelst%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20/James%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20/Slacking%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20/str8tsknacker
which reflects the change of relevant part of template from

          <a href="https://github.com/history/%7B%7Brange%20$index2,%20$results2%20:=%20.PlayerNames%7D%7D%7B%7Bif%20$index2%7D%7D/%7B%7Bend%7D%7D%7B%7B$results2%7D%7D%7B%7Bend%7D%7D">
            {{range $index2, $results2 := .PlayerNames}}{{if $index2}}, {{end}}{{$results2}}{{end}}
          </a>

to

              <a
                href="/history/{{ range $index2, $results2 := .PlayerNames }}
                  {{ if $index2 }}/{{ end }}{{ $results2 }}
                {{ end }}"
              >
                {{ range $index2, $results2 := .PlayerNames }}
                  {{ if $index2 }},{{ end }}{{ $results2 }}
                {{ end }}
              </a>

in this commit: b00c4e9.
In particular the href attribute currently includes all the whitespaces, rendering invalid links. Reformatting of the body of "a" tag caused just a cosmetic error.

@Zamiell
Copy link
Collaborator

Zamiell commented Aug 14, 2025

oh, then the fix is to just add some hyphens, not disable prettier or change the whitespace.
see this page which describes how to do it:

@Zamiell
Copy link
Collaborator

Zamiell commented Aug 14, 2025

can you make it pass CI now

@Zamiell
Copy link
Collaborator

Zamiell commented Sep 16, 2025

@mg6-hanabi ping?

@vEnhance
Copy link
Contributor

vEnhance commented Nov 2, 2025

@Zamiell this should pass CI now.

(though actually i think prettier-plugin-go-template is making a mistake with 9fe36b2 where its reformatting removes the space after the comma in @mg6-hanabi 's commit and thus breaks the presentation... but breaking the line like this instead seems to work around it anyhow.)

@vEnhance
Copy link
Contributor

vEnhance commented Nov 2, 2025

(and yes, i tested this)

@Zamiell
Copy link
Collaborator

Zamiell commented Nov 3, 2025

thanks

@Zamiell Zamiell merged commit b008604 into Hanabi-Live:main Nov 3, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants