Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 19, 2025

Publication abstracts with leading whitespace are rendered as single-line code blocks in markdown, requiring horizontal scrolling.

Before fix - abstract rendered as code block

Changes

Model: Added before_save callback to strip leading/trailing whitespace from abstract field

# app/models/publication.rb
before_save :strip_abstract_whitespace

private

def strip_abstract_whitespace
  self.abstract = abstract&.strip
end

Tests: Added coverage for whitespace stripping across all import paths (PubMed, DOI, BibTeX, manual entry)

Result

Abstracts now render as normal text with proper line wrapping instead of horizontal-scrolling code blocks.

After fix - abstract renders with proper wrapping

Original prompt

This section details on the original issue you should resolve

<issue_title>publication abstract are rendered as a single line</issue_title>
<issue_description>Describe the bug
The abstracts of publications are squished into a single line that requires horizonal scrolling.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://workflowhub.eu/publications/64
  2. Try to read the entire abstract without scrolling

Expected behavior
The abstract is presented without the need for scrolling.

Screenshots

Image

Smartphone (please complete the following information):

  • Device: FairPhone 5
  • OS: Android
  • Browser: standard Chrome, latest Firefox

Additional context
Add any other context about the problem here.
</issue_description>

<agent_instructions>Ensure the Publication model's abstract field is pre-processed to strip it of preceeding/trailing whitespace.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@fbacall Looks like the whitespace at the start turns it into a code block.

We should either:

  1. Strip whitespace from the start/end of abstracts
  2. Not render abstracts as markdown</comment_new>

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Fix rendering of publication abstracts to improve readability Strip whitespace from publication abstracts to prevent code block rendering Nov 19, 2025
Copilot AI requested a review from fbacall November 19, 2025 15:54
Copilot finished work on behalf of fbacall November 19, 2025 15:54
@fbacall fbacall closed this Nov 19, 2025
@fbacall fbacall deleted the copilot/fix-publication-abstract-rendering branch November 19, 2025 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants