[Bug 39202] New: Lots of instances of HTML closing tags being on a separate line
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39202 Bug ID: 39202 Summary: Lots of instances of HTML closing tags being on a separate line Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: lucas@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org After tidying I see many instances on HTML closing tags `>` being on its own line. I used `git grep -nP '^\s*>\s*$'` to see that there are many cases of this. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39202 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |38664, 38713 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38664 [Bug 38664] Tidy the whole codebase https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38713 [Bug 38713] Incorrect HTML structures -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39202 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39202 --- Comment #1 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- There are other problems with HTML structure like: <li ><a class="revert_recall dropdown-item" data-id="[% recall.id | html %]"><i class="fa fa-undo"></i> Revert waiting</a></li
I suspect we don't want this. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39202 Phil Ringnalda <phil@chetcolibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |phil@chetcolibrary.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39202
Jonathan Druart <jonathan.druart@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jonathan.druart@gmail.com
--- Comment #2 from Jonathan Druart <jonathan.druart@gmail.com> ---
> I suspect we don't want this.
I want this. At least we wanted it during the "tidy all".
It has been advertised and explained during the work, and is in the document
https://koha-hedgedoc.servers.llownd.net/Bug-38664_Tidy-the-whole-codebase,
section "The translation process".
After the tidy we have:
```
- <option value="r" selected="selected">Remote-sensing
image</option>
+ <option value="r" selected="selected">
+ Remote-sensing image
+ </option>
```
It will generate the following changes in the .po files:
```
+#:
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_007.tt:89
+#, fuzzy, c-format
+msgid "Remote-sensing image "
+msgstr "Image de télédétection"
```
I have tried to fix this in the translation script, see commit "WIP trim
msgid". It actually fixes some problem with the current script:
```
+#. For the first occurrence,
#. SCRIPT
-#:
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_007.tt:114
+#:
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_007.tt:139
msgid "b- Large print"
msgstr "b- Gros caractères"
-#. SCRIPT
-#:
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_007.tt:114
-msgid "b- Large print "
-msgstr "b- Gros caractères "
```
Was it enough?
No it was not, we were loosing important spaces in some places.
SOLUTION - we modified prettier's default behaviour:
https://prettier.io/docs/en/options.html#html-whitespace-sensitivity
Using "htmlWhitespaceSensitivity: 'strict'" in `.prettierrc.js` fixes the
problem by splitting the tags themselves
```
+ [% IF m.version == ( mm.version )
%]
+ <ul
+
><li><strong>Mentor:</strong> [% INCLUDE person p=mm %]</li></ul
+ >
+ [% END %]
```
So we don't always need to split the tags. We could manually fix, but it needs
to be done on a case-by-case basis.
--
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39202 --- Comment #3 from Jonathan Druart <jonathan.druart@gmail.com> --- > I suspect we don't want this. We wanted this. At least we did during the "tidy all" initial process. It has been advertised and explained during the work, and is in the document https://koha-hedgedoc.servers.llownd.net/Bug-38664_Tidy-the-whole-codebase, section "The translation process". After the tidy we have: ``` - <option value="r" selected="selected">Remote-sensing image</option> + <option value="r" selected="selected"> + Remote-sensing image + </option> ``` It will generate the following changes in the .po files: ``` +#: koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_007.tt:89 +#, fuzzy, c-format +msgid "Remote-sensing image " +msgstr "Image de télédétection" ``` I have tried to fix this in the translation script, see commit "WIP trim msgid". It actually fixes some problem with the current script: ``` +#. For the first occurrence, #. SCRIPT -#: koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_007.tt:114 +#: koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_007.tt:139 msgid "b- Large print" msgstr "b- Gros caractères" -#. SCRIPT -#: koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_007.tt:114 -msgid "b- Large print " -msgstr "b- Gros caractères " ``` Was it enough? No it was not, we were loosing important spaces in some places. SOLUTION - we modified prettier's default behaviour: https://prettier.io/docs/en/options.html#html-whitespace-sensitivity Using "htmlWhitespaceSensitivity: 'strict'" in `.prettierrc.js` fixes the problem by splitting the tags themselves ``` + [% IF m.version == ( mm.version ) %] + <ul + ><li><strong>Mentor:</strong> [% INCLUDE person p=mm %]</li></ul + > + [% END %] ``` So we don't always need to split the tags. We could manually fix, but it needs to be done on a case-by-case basis. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39202 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |INVALID --- Comment #4 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Thanks for taking the time to explain, I think we can resolve this. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39202 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|INVALID |DUPLICATE --- Comment #5 from Jonathan Druart <jonathan.druart@gmail.com> --- *** This bug has been marked as a duplicate of bug 39085 *** -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39202 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #6 from Jonathan Druart <jonathan.druart@gmail.com> --- *** Bug 39330 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39202 Bug 39202 depends on bug 38713, which changed state. Bug 38713 Summary: Incorrect HTML structures https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38713 What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39202 Bug 39202 depends on bug 38664, which changed state. Bug 38664 Summary: Tidy the whole codebase https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38664 What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org