Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #5282

Closed
Open
Created Oct 06, 2013 by Administrator@rootOwner

Event note truncates html links

Created by: prototype

GitLab appears to be using Rails' ActionView::Helpers::TextHelper::truncate method in events_helper.rb (#event_note(1)). Rails' truncate method however does not have any knowledge of html tags such as links that are commonly used by us to clarify an issue. Instead, it just truncates based on last occurance of a token and the max length.

This causes issue descriptions containing links at the end of the max length to be broken when rendered via event_note, such is the case at a project's dashboard. This problem can be solved by using a different truncate method that understands html and there appear to be many of these already available, e.g. https://github.com/hgmnz/truncate_html that appears to not have any additional dependencies.

Assignee
Assign to
Time tracking