From 9f5374d1a02c5255576215f57e71fee282e81863 Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Fri, 23 Oct 2026 18:00:16 -0500 Subject: [PATCH] Update the @openwebwork/prettier-plugin-mojolicious-html-template package. The new version fixes formatting of style attributes which prettier does by default, but was not working with the Mojolicious template handling. All of the files have been formatted with prettier with the fix. --- htdocs/package-lock.json | 18 ++++---- htdocs/package.json | 2 +- .../AchievementsLeaderboard.html.ep | 4 +- .../CourseAdmin/add_course_form.html.ep | 2 +- templates/ContentGenerator/Feedback.html.ep | 2 +- .../Feedback/feedback_email.html.ep | 40 ++++++++++++----- .../AchievementList/edit_table.html.ep | 2 +- .../Instructor/FileManager/archive.html.ep | 2 +- .../Instructor/ProblemSetDetail.html.ep | 4 +- .../Instructor/Scoring.html.ep | 2 +- .../Instructor/SendMail/main_form.html.ep | 2 +- templates/ContentGenerator/Problem.html.ep | 2 +- templates/exception_default.html.ep | 44 +++++++++---------- templates/exception_min.html.ep | 6 +-- 14 files changed, 76 insertions(+), 56 deletions(-) diff --git a/htdocs/package-lock.json b/htdocs/package-lock.json index 95cd632758..b007e5362a 100644 --- a/htdocs/package-lock.json +++ b/htdocs/package-lock.json @@ -21,7 +21,7 @@ "sortablejs": "^1.15.7" }, "devDependencies": { - "@openwebwork/prettier-plugin-mojolicious-html-template": "^0.0.2", + "@openwebwork/prettier-plugin-mojolicious-html-template": "^0.0.3", "autoprefixer": "^10.5.4", "chokidar": "^5.0.0", "cssnano": "^8.0.2", @@ -300,9 +300,9 @@ } }, "node_modules/@lezer/lr": { - "version": "1.4.10", - "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.4.10.tgz", - "integrity": "sha512-rnCpTIBafOx4mRp43xOxDJbFipJm/c0cia/V5TiGlhmMa+wsSdoGmUN3w5Bqrks/09Q/D4tNAmWaT8p6NRi77A==", + "version": "1.4.11", + "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.4.11.tgz", + "integrity": "sha512-UwgZcl1R66H2hDzBrA7kWyYmX6s8p5TQ+e/t7CuvgCtBEPxbEPaHYHu+pJBvTvDotEJpuQkJjbXuHiw5Cixxgw==", "license": "MIT", "dependencies": { "@lezer/common": "^1.0.0" @@ -370,16 +370,16 @@ } }, "node_modules/@openwebwork/prettier-plugin-mojolicious-html-template": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/@openwebwork/prettier-plugin-mojolicious-html-template/-/prettier-plugin-mojolicious-html-template-0.0.2.tgz", - "integrity": "sha512-4COpqTjDuTIMxCWOykgVzuydhqrUfIqfuNR/4UchAmkDIPFPZok843/e9JrhrVAFZ3m7vmInwW0rxqljbY9IEw==", + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/@openwebwork/prettier-plugin-mojolicious-html-template/-/prettier-plugin-mojolicious-html-template-0.0.3.tgz", + "integrity": "sha512-Z4/2PxHB0jZl2VtKyVJOlzVdoR8Rg4SPea+cifpVu06gbIYUN2BU/9it/pg6VuKJ928qtV/6LJGwZf5LmNEtzQ==", "dev": true, "license": "LGPL-3.0-or-later", "dependencies": { - "@lezer/lr": "^1.4.10" + "@lezer/lr": "^1.4.11" }, "peerDependencies": { - "prettier": "^3.9.4" + "prettier": "3.9.4 - 3.9.10" } }, "node_modules/@parcel/watcher": { diff --git a/htdocs/package.json b/htdocs/package.json index 85c4690cd6..a328e9f71c 100644 --- a/htdocs/package.json +++ b/htdocs/package.json @@ -27,7 +27,7 @@ "sortablejs": "^1.15.7" }, "devDependencies": { - "@openwebwork/prettier-plugin-mojolicious-html-template": "^0.0.2", + "@openwebwork/prettier-plugin-mojolicious-html-template": "^0.0.3", "autoprefixer": "^10.5.4", "chokidar": "^5.0.0", "cssnano": "^8.0.2", diff --git a/templates/ContentGenerator/AchievementsLeaderboard.html.ep b/templates/ContentGenerator/AchievementsLeaderboard.html.ep index 9a4511de34..c58396acf6 100644 --- a/templates/ContentGenerator/AchievementsLeaderboard.html.ep +++ b/templates/ContentGenerator/AchievementsLeaderboard.html.ep @@ -30,7 +30,7 @@ <%= $rank %> <%= $points %> % if ($c->{showLevels}) { - + % if ($level) { <%= $level->{name} %>
@@ -43,7 +43,7 @@ % } % if ($c->{showUserNames}) { - + <%= $user->first_name %>
<%= $user->last_name %> % } diff --git a/templates/ContentGenerator/CourseAdmin/add_course_form.html.ep b/templates/ContentGenerator/CourseAdmin/add_course_form.html.ep index 89b4b2e0a6..542de2e083 100644 --- a/templates/ContentGenerator/CourseAdmin/add_course_form.html.ep +++ b/templates/ContentGenerator/CourseAdmin/add_course_form.html.ep @@ -67,7 +67,7 @@ $ce->{admin_course_id}) =%>
-
+
% for my $user ($db->listUsers) { % my $val = $db->getPermissionLevel($user)->permission; % my $role = maketext((grep { $ce->{userRoles}{$_} eq $val } keys %{ $ce->{userRoles} })[0]); diff --git a/templates/ContentGenerator/Feedback.html.ep b/templates/ContentGenerator/Feedback.html.ep index 478f7244da..d4ed38f4d0 100644 --- a/templates/ContentGenerator/Feedback.html.ep +++ b/templates/ContentGenerator/Feedback.html.ep @@ -16,7 +16,7 @@
% for (split /\n\r?/, param('feedback')) { % if ($_) { -

<%= $_ %>

+

<%= $_ %>

% } else {
% } diff --git a/templates/ContentGenerator/Feedback/feedback_email.html.ep b/templates/ContentGenerator/Feedback/feedback_email.html.ep index 193c08f25d..c30bbd6c06 100644 --- a/templates/ContentGenerator/Feedback/feedback_email.html.ep +++ b/templates/ContentGenerator/Feedback/feedback_email.html.ep @@ -37,8 +37,12 @@ <%= maketext('Data about the problem') %> @@ -98,8 +102,12 @@ <%= maketext('Data about the assignment') %> @@ -145,8 +153,12 @@ <%= maketext('Data about the problem processor') =%> @@ -175,8 +187,12 @@ <%= maketext('Data about the user') %> @@ -217,8 +233,12 @@ <%= maketext('Data about the environment') %> diff --git a/templates/ContentGenerator/Instructor/AchievementList/edit_table.html.ep b/templates/ContentGenerator/Instructor/AchievementList/edit_table.html.ep index 2520f26933..5696d28005 100644 --- a/templates/ContentGenerator/Instructor/AchievementList/edit_table.html.ep +++ b/templates/ContentGenerator/Instructor/AchievementList/edit_table.html.ep @@ -57,7 +57,7 @@
% for my $field (@{ $_->{fields} }) { - + <%= include 'ContentGenerator/Instructor/AchievementList/edit_table_row', fieldName => "achievement.$achievement_id.$field", diff --git a/templates/ContentGenerator/Instructor/FileManager/archive.html.ep b/templates/ContentGenerator/Instructor/FileManager/archive.html.ep index 3367568216..93f6184765 100644 --- a/templates/ContentGenerator/Instructor/FileManager/archive.html.ep +++ b/templates/ContentGenerator/Instructor/FileManager/archive.html.ep @@ -1,6 +1,6 @@ % use Mojo::File qw(path); % -
+
<%= maketext('The following files have been selected for archiving. Select the type ' diff --git a/templates/ContentGenerator/Instructor/ProblemSetDetail.html.ep b/templates/ContentGenerator/Instructor/ProblemSetDetail.html.ep index 5c027ba925..9b20c63370 100644 --- a/templates/ContentGenerator/Instructor/ProblemSetDetail.html.ep +++ b/templates/ContentGenerator/Instructor/ProblemSetDetail.html.ep @@ -189,7 +189,7 @@
% % # General set information -
+
<%= maketext('Set Parameters') %>
@@ -234,7 +234,7 @@ % % # Display header information % if (!@editForUser) { -
+
<%= maketext("Headers") %>
% for my $headerType (@$headers) { diff --git a/templates/ContentGenerator/Instructor/Scoring.html.ep b/templates/ContentGenerator/Instructor/Scoring.html.ep index d9c262f136..392b36eb34 100644 --- a/templates/ContentGenerator/Instructor/Scoring.html.ep +++ b/templates/ContentGenerator/Instructor/Scoring.html.ep @@ -112,7 +112,7 @@ <%= link_to $c->{scoringFileName} => $c->systemLink(url_for('instructor_scoring_download'), params => { getFile => $c->{scoringFileName} }), class => 'font-monospace' =%> -
+	
 		<%== readFile("$scoringDir/$c->{scoringFileName}") =%>\
 	
% } diff --git a/templates/ContentGenerator/Instructor/SendMail/main_form.html.ep b/templates/ContentGenerator/Instructor/SendMail/main_form.html.ep index 6fec5ed234..8204445628 100644 --- a/templates/ContentGenerator/Instructor/SendMail/main_form.html.ep +++ b/templates/ContentGenerator/Instructor/SendMail/main_form.html.ep @@ -212,7 +212,7 @@ % } % } % if (@rows) { -
<% =%>\
+			
<% =%>\
 				<%== join('', ' ', $c->data_format(1 .. $cols)) =%>
<% =%>\ <%== join('
', map { join('', ' ', $c->data_format2(@$_)) } @rows) =%>\
diff --git a/templates/ContentGenerator/Problem.html.ep b/templates/ContentGenerator/Problem.html.ep index 48f1e5ab9f..c3b95f068e 100644 --- a/templates/ContentGenerator/Problem.html.ep +++ b/templates/ContentGenerator/Problem.html.ep @@ -88,7 +88,7 @@ % if ($c->{pg}{render_fail}) {
-

<%= maketext('PG question failed to render') %>

+

<%= maketext('PG question failed to render') %>

<%= maketext('Processing of this PG problem was not completed. Probably because of a ' . 'syntax error. The translator died prematurely and no PG warning messages were transmitted.' diff --git a/templates/exception_default.html.ep b/templates/exception_default.html.ep index 5fd866ada0..7b691e5e17 100644 --- a/templates/exception_default.html.ep +++ b/templates/exception_default.html.ep @@ -9,7 +9,7 @@ % -

+

WeBWorK error

An error occurred while processing your request.

@@ -21,7 +21,7 @@ , including all of the following information as well as what you were doing when the error occurred.

Error record identifier

-

<%= $uuid =%>

+

<%= $uuid =%>

% if (my $warnings = stash 'warnings') {

Warning messages

    @@ -32,24 +32,24 @@ % } % if (my $exception = stash 'exception') {

    Error messages

    -

    <%= $exception->message =%>

    +

    <%= $exception->message =%>

    Context

      % for (@{ $exception->lines_before }) {
    • -
      <%= $_->[0] %>: <%= $_->[1] %>
      +
      <%= $_->[0] %>: <%= $_->[1] %>
    • % } % if (defined $exception->line->[1]) {
    • -
      <% =%>\
      +							
      <% =%>\
       							<%= $exception->line->[0] %>: <%= $exception->line->[1] %><% =%>\
       						
    • % } % for (@{$exception->lines_after}) {
    • -
      <%= $_->[0] %>: <%= $_->[1] %>
      +
      <%= $_->[0] %>: <%= $_->[1] %>
    • % }
    @@ -66,35 +66,35 @@

    Request information

    The HTTP request information is included in the following table.

    -
    - +
    +
    - - + + - - + + - - + - -
    HTTP request information
    ItemDataItemData
    Method<%= $c->req->method %>Method<%= $c->req->method %>
    URI + URI <%= $c->req->url->to_abs->to_string %>
    HTTP Headers - + +
    HTTP Headers + - - + + % my %headers = %{ $c->req->headers->to_hash }; % if (defined($headers{'sec-ch-ua'})) { @@ -105,10 +105,10 @@ % } % for (keys %headers) { - - @@ -120,7 +120,7 @@

    Time generated:

    -

    <%= $time %>

    +

    <%= $time %>

    diff --git a/templates/exception_min.html.ep b/templates/exception_min.html.ep index 5fe7f09082..c86ce742b0 100644 --- a/templates/exception_min.html.ep +++ b/templates/exception_min.html.ep @@ -9,7 +9,7 @@ % -
    +

    WeBWorK error

    An error occurred while processing your request.

    @@ -21,9 +21,9 @@ , including the following information as well as what what you were doing when the error occurred.

    Error record identifier

    -

    <%= $uuid %>

    +

    <%= $uuid %>

    Time generated:

    -

    <%= $time %>

    +

    <%= $time %>

    HTTP request headers
    KeyValueKeyValue
    + <%= $_ %> + <%= $headers{$_} %>