Closed zachczx closed 2 weeks ago
Hi @zachczx , thanks for the bug report. You have encountered a common footgun with templ, the issue is that the word after the a
is if
, here is the documentation for this behaviour: https://templ.guide/syntax-and-usage/statements#ifswitchfor-within-text
Ah I'm so sorry, I read the docs and these lines many times, but I must've had a brain fart and skipped over the "if" after.
Did we not change the behaviour of the if
parser to handle this case? I remember talking about it, maybe we overlooked making the change.
I had the same thought @a-h ..
Maybe did we only implement it for one keyword to start with?
Hi, I encountered a minor bug (?) with Templ. Not a dealbreaker by any means, just made me puzzled for half an hour before realizing this was the cause when templ generate kept throwing errors.
This doesn't work - having an "a" tag immediately followed by text - throws error when generating code.
This doesn't either.
This works fine.
templ info
output templ info (✓) os [ goos=windows goarch=amd64 ] (✓) go [ location=C:\Program Files\Go\bin\go.exe version=go version go1.23.3 windows/amd64 ] (✓) gopls [ location=C:\Users\z\go\bin\gopls.exe version=golang.org/x/tools/gopls v0.16.2 ](✓) templ [ location=C:\Users\z\go\bin\templ.exe version=v0.2.793 ]