Comments (12)
Should be resolved in #49 .
from prettier-plugin-go-template.
So it seems to be that if you have a file with a missing {{ end }}
it seems to affect other files when using this plugin within visual studio. If you never open that file things are ok, but once you open that file it seems to prevail until you restart visual studio.
from prettier-plugin-go-template.
Same issue here; as far as I can tell, if you ever save a file with a missing {{ end }}
, you have to restart VSCode. =(
from prettier-plugin-go-template.
Ah that's good input @cpence & @richtera. I guess I know why this is happening.
I'll try a quick fix 👍
from prettier-plugin-go-template.
@richtera @cpence should be fixed in 0.0.11-beta.4
.
Would be nice if one of you could confirm that the version resolves the error.
I'll publish it as the latest version then. Already tested it myself and seems to work just fine:
npm i [email protected]
(Don't forget to restart VSCode / Extension Host after installing.)
Thanks for your help ❤️
from prettier-plugin-go-template.
@all-contributors please add @cpence for bug
from prettier-plugin-go-template.
I've put up a pull request to add @cpence! 🎉
from prettier-plugin-go-template.
As far as I can tell, the fix works! Thanks so much!
from prettier-plugin-go-template.
Hmmm, I am getting problems when using this commit version from the command line.
Example file
{{ $commitId := index .Site.Params.courseInfo .Parent.Params.meta.id "commitId" | default "" }}
{{ $courseSha := index .Site.Params.courseInfo .Parent.Params.meta.id "sha" "course" .Parent.Params.meta.id | default "" }}
{{ $lessonSha := index .Site.Params.courseInfo .Parent.Params.meta.id "sha" "lesson" .Params.meta.id | default "" }}
<div
class="course-card m-auto"
data-bind="{{ printf "using: getLesson({ courseId: %s, lessonId: %s, courseSha: %s, lessonSha: %s, commitId: %s })" (.Parent.Params.meta.id | jsonify) (.Params.meta.id | jsonify) ($courseSha | jsonify) ($lessonSha | jsonify) ($commitId | jsonify) }}"
>
<div class="lesson-svg overall-button" style="cursor: pointer;">
<a class="course-button plain" href="{{ .RelPermalink }}">
<circle-dial
params="value: overallQuestionsPCorrect, nullText: ''"
></circle-dial>
<p class="text-center">
{{ .Params.heading | plainify | markdownify }}
</p>
</a>
</div>
</div>
themes/ui/layouts/test-prep-lessons/lesson-list-item-first.html
[error] themes/ui/layouts/test-prep-lessons/lesson-list-item-first.html: SyntaxError: Unexpected closing tag "div". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags (18:1)
[error] 16 | </a>
[error] 17 | </div>
[error] > 18 | </div>
[error] | ^^^^^^
[error] 19 |
It's somehow losing track of counting in some cases now. Not sure how it would be related.
from prettier-plugin-go-template.
I think it may have something to do with {{ }} inside of quotes or attributes or in the same line.
I also see problems in the following case:
| <div class="question-stem ck-content">
[error] > 3 | {{ .Params.content | replaceRE "<blank (.*?)</blank>" "<blank class=\"blank\"></blank>" | safeHTML }}
[error] | ^^^^^^^^
[error] 4 | </div>
[error] 5
from prettier-plugin-go-template.
@richtera Looks like the error is coming from " inside {{ }}. I'll check whether this is also a quick fix.
from prettier-plugin-go-template.
FYI this doesn't happen in the release version.
from prettier-plugin-go-template.
Related Issues (20)
- Can't make it work in VSCode on gohtml with pnpm HOT 1
- Unintended whitespace is inserted into the value of an HTML attribute
- Upgrade prettier peer dependency to `^3.0.0` HOT 3
- Closing tag is spit on log tags and log lines HOT 2
- Nvim support check HOT 1
- support for Templ files HOT 1
- File with just text and go template command is not idempotent HOT 2
- Financial donations? HOT 1
- Different formatting result after formatting once HOT 2
- Idempotency bug w/ unclosed multiline string
- Error - Found invalid node block HOT 5
- Formatting fails for HTML custom elements HOT 5
- Error thrown when formatting dynamic HTML tag like `<h{{ .Level }}></h{{ .Level }}>`
- prettier print/embed are async now
- Lines containing variable definitions cause double-empty lines HOT 2
- confused by multiline comments containing syntax HOT 1
- prettier-ignore comments don't work for html fragments HOT 3
- fails on html tags using if/else HOT 2
- Migrate to Prettier v3 HOT 2
- Use With Pre-commit hooks HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prettier-plugin-go-template.