- πΊπΈUnited States ultimike Florida, USA
I'm happy to give this a proper review, but I'd like to add some test coverage for this change. I'm happy to add the test coverage, but I'd like some assistance in making sure we are testing the right stuff. I'm fine with both traditional code comments and the
<!--break-->tag being part of this single issue as long as there is proper code coverage for both.
Our Unit tests allow us to test both trimming by characters and words. The input data for the character trimming test looks like this:
- The string to be trimmed.
- Number of characters to be trimmed.
- Suffix.
- Expected output.So, as an example,
- This is the string to be trimmed. - 15 - ... - This is the string...
Similarly, for the word trimming test, the input data is:
- The string to be trimmed.
- Number of words to be trimmed.
- Suffix.
- Expected output.It would be great for someone to provide some input data for the tests in a comment below (or add it to the patch!) that includes both twig_debug style code comments and a
<!--break-->tag.
Make sense?
thanks,
-mike - Status changed to Needs work
about 2 years ago 11:05am 30 March 2023 - πΊπΈUnited States ultimike Florida, USA
Forgot to change the status...
- last update
almost 2 years ago Patch Failed to Apply - πΊπΈUnited States ultimike Florida, USA
I agree with @eelkeblok that we should spin the
<!--break-->stuff off into a separate issue. I have done so: π Properly handle HTML comment Active .
Moving forward, this issue will utilize the issue fork (no more patches, please) and focus on non-break HTML comments only.
I have updated the issue title to reflect this change.
- @ultimike opened merge request.
- Assigned to markie
- Status changed to Needs review
almost 2 years ago 4:53pm 18 June 2023 - πΊπΈUnited States ultimike Florida, USA
Fix and tests ready for review in issue fork. All tests are passing.
I took a slightly different approach than the patches from @ckaotik and @Ruedische - the code I added to the service methods removes all comment elements from the DOM before our trimming code gets going.
-mike
- πΊπΈUnited States ultimike Florida, USA
Thinking about this while I was offline (I know, right?) I realized that the DOM comment remover wasn't going to remove all comment elements. I've improved it and added more realistic tests.
Ready for review.
-mike
- Assigned to ultimike
- Status changed to Needs work
almost 2 years ago 5:07pm 19 June 2023 - πΊπΈUnited States ultimike Florida, USA
Assigning this back to me. Also, I'll look into adding a unit test specifically for the new
removeHtmlComments()
method.-mike
- Assigned to markie
- Status changed to Needs review
almost 2 years ago 3:55pm 24 June 2023 - πΊπΈUnited States ultimike Florida, USA
@markie,
I've moved
removeHtmlComments()
as suggested and added a new unit test specifically for it.-mike
- Status changed to Needs work
almost 2 years ago 6:49pm 24 June 2023 - Status changed to Needs review
almost 2 years ago 3:09pm 26 June 2023 -
markie β
committed 34dc3d52 on 2.1.x authored by
ultimike β
Issue #2915188 by ultimike, ckaotik, Ruedische, markie: Truncate must...
-
markie β
committed 34dc3d52 on 2.1.x authored by
ultimike β
- Status changed to Fixed
almost 2 years ago 7:47pm 8 July 2023 - πΊπΈUnited States markie Albuquerque, NM
reviewed and merged. Thanks for the assistance.
Automatically closed - issue fixed for 2 weeks with no activity.