Problem/Motivation
Long strings within comments break the layout of the page.
How to replicate:
Make a comment with very long line (like ______________________) or a long url
It will break the layout of the comment boxes.
Example screenshots:



Current code at HEAD for the .comment__content wrapper
.comment__content {
position: relative;
display: table-cell;
padding: 10px 25px 10px 25px;
vertical-align: top;
width: 100%;
border: 1px solid #d3d7d9;
font-size: 0.929em;
line-height: 1.6;
}
Proposed resolution
Add a fix so that long strings wrap within the .comment__content container.
Remaining tasks
Write a patch
Visual review - Post screenshots
Code review
User interface changes
Fixes a broken page layout caused by long strings in comments.
API changes
none
Data model changes
none
Beta phase evaluation
Comments
Comment #1
corbacho commentedI removed that fix because wasn't working in Google Chrome.
Comment #2
tatianataylor commentedCorbacho,
Would you be able to say which .inc file or module was this code at? I am trying to find where is the issue in the code first so maybe I can create a patch.
Thanks,
T.
Comment #3
kpun commentedComment #4
kpun commented@Corbacho i think the changes you have mentioned should be made in the .comment section .
Comment #5
corbacho commentedHi kpun, I can't replicate anymore the bug in Drupal 7. It seems it has been fixed with the solution you are proposing.
btw, The patch contains changes to the menu.module that shouldn't be there.
I was going to close the issue... but I can replicate the problem in Drupal 8 (changing issue metadata)
Could you add these 3 lines to Drupal 8 ? I tested on Chrome devtools, and it worked.
Comment #6
corbacho commentedComment #7
kpun commenteddone
Comment #11
kpun commentedComment #12
kpun commentedComment #14
kpun commentedcorbacho could you please tell why the patch does not work ? I am not able to figure it out.
Comment #15
corbacho commentedThanks for the patch!
it seems a random error, not related to the patch. Let's try again
Comment #20
corbacho commentedme not understand
Comment #23
corbacho commentedlet's try re-uploading patch #7 from kpun (credit to him)
Comment #27
emma.mariaAh! The reason why it is not working is that style.css does not exist in Bartik in D8. The CSS now has a SMACSS style architecture so the patch needs to affect the new files.
Comment #28
emma.mariaI have also found this issue within a Forum table also...
Comment #29
corbacho commented:O mistery solved!
I'll ping kpun if he wants to finish the job
Comment #30
rudraram commented@emma.maria @corbacho This issue looks file with the comment section but exists with the forums table. Attaching comment section screenshot.
Comment #31
emma.mariaThe issue posted in #28 is different to the original issue. The original issue is with no word spacing.
I will have a test and maybe post a seperate issue.
Also unassigning for now as @kpun has not been active on this issue for a month and we should open it up again.
Comment #32
emma.mariaLet's ignore the Forum table issue within this issue, it's not the same.
The issue here is that if you add a long string to a comment, it will continue to push the comment out of the page container because of this style. This is particularly needed for small mobile widths as the space for comments is so small...



I tried using the solution posted in the IS and the previous patch to the current codebase but it caused further regressions and did not help :-(
The comments code has been refactored since this bug was discovered. So we need a new CSS solution!
The current code on the comment content is...
PS.
word-wrap: break-wordwhich is set on the body does not work on mobile devices for some reason.Comment #33
emma.mariaI've updated the Issue summary.
Comment #34
emma.mariaComment #35
rudraram commentedAs
word-wrap: break-wordis not working on mobile devices I have usedword-break: break-alljust for the.comment__wrapper. I don't know if this is ok but it works. Patch uploadedComment #36
rudraram commentedComment #38
rudraram commented@emma.maria The below image from your upload shows 8.0.x and the version for this issue is mentioned as 8.1.x-dev.

Comment #39
emma.mariaOk thanks, I've changed the version to 8.0.x I would like this fixed ASAP.
Comment #41
rudraram commented@emma.maria Thoughts on #35 ?
Comment #42
briandev commentedMaybe we can set the "break-word" to only apply to anchor links within comments:
Comment #43
emma.mariaThanks @rudraram for the patch!
I can confirm that word-wrap has no effect but word-break fixes the visual issue.
I checked
word-breakon caniuse.com and it has pretty good support.Namely the
word-break: break-wordcombination has this description...Therefore I am happy with this solution!
Screenshots:
Chrome
Firefox
Safari
IE9
Comment #45
martins.kajins commentedComment #47
emma.maria@martins.kajins thanks for your patch. However your solution you provided is different from the patch that was tested, solved the issue and was set to RTBC in #35.
The patch in #35 was set to red by the testbot and still cleanly applies. It is retesting now and I will set this back to RTBC based on #35 again.
Comment #48
emma.mariaTo avoid confusion with what patch to commit here is a straight re-upload of @rudraram's patch from #35.
Setting this issue back to RTBC.
Comment #49
webchickCommitted and pushed to 8.0.x. Thanks!
Comment #52
paintingguy commentedSorry if I am duplicating the Q&A but I'm having this issue right now with D8 current release. Is there a fix in this post ? Thanks.
Comment #53
paintingguy commentedAh, I tried this and it worked:
diff --git a/core/themes/bartik/css/components/comments.css b/core/themes/bartik/css/components/comments.css
index 30e1be8..03bbfd1 100644
--- a/core/themes/bartik/css/components/comments.css
+++ b/core/themes/bartik/css/components/comments.css
@@ -61,6 +61,7 @@
Comment #54
jonathanshawI wonder if this issue has introduced a regression: #2679126: Words break unnecessarilly at end of line in forum topic replies.
Perhaps #42 above offers a direction.
Comment #55
jonathanshawAn alternative solution to this issue is now proposed in #2679126