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
  • Merge requests
  • !1232

Merged
Created 12 years ago by Administrator@rootOwner

GFM Refactoring

  • Overview 6
  • Commits 3
  • Changes 2

Created by: rspeicher

According to cane, the gfm helper method was by far the most complex method in the entire project, so I tried to refactor it a bit.

I think the new one is a bit easier to understand and will be easier to maintain, especially for the regex pattern.

This also shows that there's still lots of room for improvement, particularly removing the duplication from dealing with html_options and the various link classes. I'll reply to this with some ideas.

Loading
Loading

  • Administrator
    Administrator @root · 12 years ago
    Owner

    Created by: dzaporozhets

    oh great. Waiting for travis bot :)

    By Administrator on 2012-08-14T08:44:54 (imported from GitLab project)

  • Administrator
    Administrator @root · 12 years ago
    Owner

    Created by: rspeicher

    So as far as further improvements, there's a ton of duplication in dealing with the html_options for the various links. I didn't entirely understand the whole interaction between link_to_gfm and gfm, but it seems like the actual parser (my new class) doesn't need to care about html_options at all. It should be able to just insert its own classes and titles. Or am I wrong there? In other words, is there a use case where you're inserting custom classes into a GFM-generated link to an issue? I couldn't find any.

    By Administrator on 2012-08-14T08:55:02 (imported from GitLab project)

  • Administrator
    Administrator @root · 12 years ago
    Owner

    Created by: travisbot

    This pull request passes (merged b039a169 into 6ebd360c).

    By Administrator on 2012-08-14T08:52:15 (imported from GitLab project)

  • Administrator
    Administrator @root · 12 years ago
    Owner

    Created by: dzaporozhets

    @tsigo gfm is a dark side of a project for me :)

    By Administrator on 2012-08-14T08:54:24 (imported from GitLab project)

  • Administrator
    Administrator @root · 12 years ago
    Owner

    Created by: dzaporozhets

    merged. thank you!

    By Administrator on 2012-08-14T12:27:23 (imported from GitLab project)

  • Administrator
    Administrator @root · 12 years ago
    Owner

    Created by: riyad

    @tsigo link_to_gfm is about dealing with gfm text that will be used in a link, think link_to(gfm(...), ...) . The problem is that it will produce nested links (i.e. <a>outer text<a>gfm ref</a>more outer text</a>). These will not be interpreted as intended. Browsers will parse something like <a>outer text</a><a>gfm ref</a>more outer text (notice the last part is not linked any more). To correct that there is link_to_gfm. It wraps all parts to explicitly produce the correct linking behavior (i.e. <a>outer text</a><a>gfm ref</a><a>more outer text</a>).

    @randx come on, it's not that dark ;)

    By Administrator on 2012-08-14T15:29:17 (imported from GitLab project)

  • You're only seeing other activity in the feed. To add a comment, switch to one of the following options.
Please register or sign in to reply
0 Assignees
Assign to
0 Reviewers
Request review from
Milestone
No milestone
None
None
Time tracking
0
Labels
None
Assign labels
  • No matching results
  • Manage project labels
Lock merge request
Unlocked
participants
Reference:
Source branch: github/fork/rspeicher/refactor_gfm

    0 pending comments