diff --git a/opentech/static_src/src/javascript/apply/submission-text-cleanup.js b/opentech/static_src/src/javascript/apply/submission-text-cleanup.js index 9c5f7b813e0ae690f191ef71c7a35d8dba91dcfb..3ed4c2adce0c81e43ae8887a83b13a34c93a8b19 100644 --- a/opentech/static_src/src/javascript/apply/submission-text-cleanup.js +++ b/opentech/static_src/src/javascript/apply/submission-text-cleanup.js @@ -2,13 +2,14 @@ 'use strict'; - $('p').each(function () { + $('.rich-text--answers').find('p').each(function () { // Detach (remove) p tag with only whitespace inside. if ($.trim($(this).text()) === '') { $(this).detach(); } }); + // Wrap all tables in a div so overflow auto works. + $('.rich-text--answers').find('table').wrap('<div class="rich-text__table"></div>'); })(jQuery); - diff --git a/opentech/static_src/src/sass/apply/abstracts/_variables.scss b/opentech/static_src/src/sass/apply/abstracts/_variables.scss index aadcc4a8f3d611d87a5ecc3edc852a17b5a54ec8..c555ad82a8f5193a39a6b6540093fb8f2b0c8b21 100644 --- a/opentech/static_src/src/sass/apply/abstracts/_variables.scss +++ b/opentech/static_src/src/sass/apply/abstracts/_variables.scss @@ -95,6 +95,9 @@ $site-width: 1280px; $wrapper--medium: 1020px; $wrapper--small: 790px; +// Text line length +$max-text-line-length: 50em; + // Breakpoints $breakpoints: ( 'mob-portrait' '(min-width: 320px)', diff --git a/opentech/static_src/src/sass/apply/components/_feed.scss b/opentech/static_src/src/sass/apply/components/_feed.scss index d3afc66ee7327436224057045a9fcf735e18661c..a16d9f5ee359adebbccfe5b72851c041ac34466a 100644 --- a/opentech/static_src/src/sass/apply/components/_feed.scss +++ b/opentech/static_src/src/sass/apply/components/_feed.scss @@ -142,6 +142,11 @@ } } + &__comment { + word-break: break-word; + max-width: $max-text-line-length; + } + &__related-item { svg { width: 10px; diff --git a/opentech/static_src/src/sass/apply/components/_rich-text.scss b/opentech/static_src/src/sass/apply/components/_rich-text.scss index 8279fcd11051308274b4dc1ae11777b5dde4dc88..375c7231f912e5f4583423163c358318eb11f507 100644 --- a/opentech/static_src/src/sass/apply/components/_rich-text.scss +++ b/opentech/static_src/src/sass/apply/components/_rich-text.scss @@ -1,6 +1,7 @@ .rich-text { margin-bottom: 2rem; word-break: break-word; + max-width: $max-text-line-length; &--answers { > section { @@ -46,6 +47,10 @@ } } + &__table { + overflow: auto; + } + a { font-weight: $weight--bold; border-bottom: 1px solid transparent;