diff --git a/app/assets/stylesheets/scss/_columns.scss b/app/assets/stylesheets/scss/_columns.scss index f7e56b7e5e..2859277e81 100644 --- a/app/assets/stylesheets/scss/_columns.scss +++ b/app/assets/stylesheets/scss/_columns.scss @@ -25,6 +25,7 @@ .c-columns__content, #page-content { padding-left: 2px; + overflow: auto; overflow-wrap: anywhere; @include bp(screen3) { diff --git a/app/javascript/react/components/MetadataEntry/Description.jsx b/app/javascript/react/components/MetadataEntry/Description.jsx index 88c9e731ae..272bd4f437 100644 --- a/app/javascript/react/components/MetadataEntry/Description.jsx +++ b/app/javascript/react/components/MetadataEntry/Description.jsx @@ -113,6 +113,12 @@ export default function Description({ table_toolbar: 'tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | ' + 'tableinsertcolbefore tableinsertcolafter tabledeletecol', content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:14px }', + invalid_styles: { + table: 'width height', + tr: 'width height', + th: 'width height', + td: 'width height', + }, branding: false, paste_block_drop: true, paste_preprocess, diff --git a/app/models/stash_datacite/description.rb b/app/models/stash_datacite/description.rb index 5da79b91d0..c0a772adc5 100644 --- a/app/models/stash_datacite/description.rb +++ b/app/models/stash_datacite/description.rb @@ -76,6 +76,13 @@ def update_search_words resource&.identifier&.update_search_words! if description_type == 'abstract' && saved_change_to_description? end + def display_desc + fragment = Nokogiri::HTML5.fragment(description) + tables = fragment.css('table') + tables.wrap('
') + fragment.to_html + end + after_save :update_search_words end end diff --git a/app/views/stash_datacite/descriptions/_show.html.erb b/app/views/stash_datacite/descriptions/_show.html.erb index 084a88685f..91c42a2b16 100644 --- a/app/views/stash_datacite/descriptions/_show.html.erb +++ b/app/views/stash_datacite/descriptions/_show.html.erb @@ -5,7 +5,7 @@