Add djangofmt HTML formatter#2736
Conversation
| <div class="callout callout-info small"> | ||
| {% if editable %} | ||
| {% blocktranslate %}Please review the evaluation's details below, add all contributors and select suitable questionnaires. Once everything is okay, please approve the evaluation on the bottom of the page.{% endblocktranslate %} | ||
| {% blocktranslate %}Please review the evaluation's details below, add all contributors and select suitable |
There was a problem hiding this comment.
we noticed these breaks in blocktranslates, we should probably add trimmed then; will look into contributing or reporting this to djangofmt
There was a problem hiding this comment.
@richardebeling So there is a builtin lint that all blocktranslates should be trimmed which we can apply with djangofmt check . --fix. Not sure if that is what we want though, seems to add more noise. Maybe we should contribute a setting so that trimmed is only needed/added if the blocktranslate spans more than one line?
There was a problem hiding this comment.
I think always putting in trimmed is fine: We only use blocktranslate, if we expect the contents to be larger/more complex, and in those cases, trimmed is basically always appropriate.
We have 117 occurrences of blocktranslate, I think it would be manageable. We can do it separately (PR/commit).
| {% blocktranslate with percentage=weight_info %}This evaluation contributes {{ percentage }} to the final grade | ||
| of the course.{% endblocktranslate %} |
There was a problem hiding this comment.
We need to somehow get trimmed in
| {% endspaceless %} | ||
| <!DOCTYPE html> |
There was a problem hiding this comment.
I think both the old and the new code are correct. Whitespace before a DOCTYPE are legal. We could also juts remove the spaceless block here.
richardebeling
left a comment
There was a problem hiding this comment.
103 files look good to me. 17 files need blocktranslate trimmed fixed, then they are also good.
| Please confirm that a grade document for the course <strong | ||
| >{{ course_name }}</strong> will be uploaded later on. |
There was a problem hiding this comment.
We have a few linebreaks like thus, inside the strong tag. A bit weird, but doesn't happen too often, so 🤷♂️
Closes #1777