OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
handle line break only long text field in project list
ulferts63e6918ae4cf
diff --git a/app/components/open_project/common/attribute_component.rb b/app/components/open_project/common/attribute_component.rbindex 12d1584a7b6..e77a2f9892b 100644--- a/app/components/open_project/common/attribute_component.rb+++ b/app/components/open_project/common/attribute_component.rb@@ -57,7 +57,7 @@ module OpenProjectenddef display_expand_button_value- multi_type? || text_ast.xpath('html/body').children.length > 1 ? :block : :none+ multi_type? || body_children.length > 1 ? :block : :noneenddef text_color@@ -67,18 +67,26 @@ module OpenProjectprivatedef first_paragraph- @first_paragraph ||= text_ast- .xpath('html/body')- .children- .first- .inner_html- .html_safe # rubocop:disable Rails/OutputSafety+ @first_paragraph ||= if body_children.any?+ body_children+ .first+ .inner_html+ .html_safe # rubocop:disable Rails/OutputSafety+ else+ ''+ endenddef text_ast@text_ast ||= Nokogiri::HTML(full_text)end+ def body_children+ text_ast+ .xpath('html/body')+ .children+ end+def multi_type?first_paragraph.include?('figure') || first_paragraph.include?('macro')end