Skip to content

Preserve line breaks in project descriptions #1017

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions app/styles/_projects.less
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@
}
}

.project-description {
.highlighted-content,
.truncated-content {
white-space: pre-line;
.word-break();
}
}

.project-info {
&.list-group-item {
border-bottom: 0;
Expand Down
4 changes: 2 additions & 2 deletions app/views/projects.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ <h2 class="h1">
</div>
<div class="list-view-pf-additional-info project-additional-info">
<span class="list-group-item-text project-description">
<truncate-long-text ng-if="!keywords.length" content="project | description" limit="265" use-word-boundary="true"></truncate-long-text>
<span ng-if="keywords.length" ng-bind-html="project | description | truncate : 1000 | highlightKeywords : keywords"></span>
<truncate-long-text ng-if="!keywords.length" content="project | description" limit="265" newline-limit="10" use-word-boundary="true"></truncate-long-text>
<span class="highlighted-content" ng-if="keywords.length" ng-bind-html="project | description | truncate : 1000 | highlightKeywords : keywords"></span>
</span>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions dist/scripts/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -11250,8 +11250,8 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"</div>\n" +
"<div class=\"list-view-pf-additional-info project-additional-info\">\n" +
"<span class=\"list-group-item-text project-description\">\n" +
"<truncate-long-text ng-if=\"!keywords.length\" content=\"project | description\" limit=\"265\" use-word-boundary=\"true\"></truncate-long-text>\n" +
"<span ng-if=\"keywords.length\" ng-bind-html=\"project | description | truncate : 1000 | highlightKeywords : keywords\"></span>\n" +
"<truncate-long-text ng-if=\"!keywords.length\" content=\"project | description\" limit=\"265\" newline-limit=\"10\" use-word-boundary=\"true\"></truncate-long-text>\n" +
"<span class=\"highlighted-content\" ng-if=\"keywords.length\" ng-bind-html=\"project | description | truncate : 1000 | highlightKeywords : keywords\"></span>\n" +
"</span>\n" +
"</div>\n" +
"</div>\n" +
Expand Down
1 change: 1 addition & 0 deletions dist/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -5166,6 +5166,7 @@ a.subtle-link:active,a.subtle-link:focus,a.subtle-link:hover{color:#00659c;borde
@media (min-width:992px){.project-actions{margin-top:0}
.project-additional-info.list-view-pf-additional-info{width:55%}
}
.project-description .highlighted-content,.project-description .truncated-content{white-space:pre-line;word-wrap:break-word;word-break:break-word;overflow-wrap:break-word;min-width:0}
.project-info.list-group-item{border-bottom:0;border-color:#e0e0e0;padding:10px 20px}
.project-info .list-view-pf-description{width:100%}
.project-info .list-view-pf-main-info{display:block}
Expand Down