Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix markdown anchor links #9673

Merged
merged 4 commits into from
Jan 16, 2020
Merged

Fix markdown anchor links #9673

merged 4 commits into from
Jan 16, 2020

Conversation

mohe2015
Copy link
Contributor

@mohe2015 mohe2015 commented Jan 9, 2020

Fix #9672

This fixes markdown anchor links by prepending #user-content to it.

If this is not the fix you are looking or if you need tests feel free to create your own pull request.
Unfortunately I don't have the time to do that.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 9, 2020
@codecov-io
Copy link

codecov-io commented Jan 9, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@b11a3cb). Click here to learn what that means.
The diff coverage is 40.24%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #9673   +/-   ##
=========================================
  Coverage          ?   42.28%           
=========================================
  Files             ?      597           
  Lines             ?    78279           
  Branches          ?        0           
=========================================
  Hits              ?    33099           
  Misses            ?    41130           
  Partials          ?     4050
Impacted Files Coverage Δ
modules/auth/repo_form.go 43.47% <ø> (ø)
models/issue_tracked_time.go 58.67% <ø> (ø)
modules/setting/git.go 65.38% <ø> (ø)
modules/queue/queue_disk_channel.go 73.22% <ø> (ø)
models/migrations/migrations.go 1.3% <ø> (ø)
modules/queue/queue_wrapped.go 8.94% <ø> (ø)
modules/repository/repo.go 26.28% <0%> (ø)
services/pull/pull.go 21.67% <0%> (ø)
cmd/doctor.go 0% <0%> (ø)
models/migrations/v119.go 0% <0%> (ø)
... and 62 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b11a3cb...fee608d. Read the comment docs.

@zeripath
Copy link
Contributor

zeripath commented Jan 9, 2020

@jolheiser What do you think of this. I remember us discussing doing this when we still had blackfriday. Was it much harder to do this fix on the blackfriday side?

@jolheiser
Copy link
Member

@jolheiser What do you think of this. I remember us discussing doing this when we still had blackfriday. Was it much harder to do this fix on the blackfriday side?

I don't remember exactly, but I think this would have broken other things in blackfriday that would have required more fixes, so we decided it wasn't worth it (at the time).

@lafriks lafriks added the type/enhancement An improvement of existing functionality label Jan 16, 2020
@lafriks lafriks added this to the 1.12.0 milestone Jan 16, 2020
Copy link
Contributor

@zeripath zeripath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably shouldn't add user-content- to links that already have it. Although I dunno.

I'm also wondering about whether we'd ever want to let markdown rendered relative links link to non rendered content - is there a way of doing that? I guess those should be fully qualified as we can't tell when markdown is rendered.

@zeripath
Copy link
Contributor

Hmm I think I'll approve this.

If we do merge it we should backport it to 1.11

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jan 16, 2020
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jan 16, 2020
@sapk sapk merged commit f740943 into go-gitea:master Jan 16, 2020
@guillep2k
Copy link
Member

Sorry I'm late, but how can we link to another comment in a thread with this change? 😕

@zeripath
Copy link
Contributor

You'd need to use the fully qualified link for it. (Which is what you should do anyway as you can't predict when the markdown is being rendered that you're on the comment page.)

@zeripath
Copy link
Contributor

zeripath commented Jan 16, 2020

e.g. https://github.com/go-gitea/gitea/pull/9673#issuecomment-575176485

or /go-gitea/gitea/pull/9673#issuecomment-575176485

@guillep2k
Copy link
Member

You'd need to use the fully qualified link for it. (Which is what you should do anyway as you can't predict when the markdown is being rendered that you're on the comment page.)

Hummm..... should we write a parser for our migration to gitea.com, replacing https://github.com/go-gitea/gitea/ with https://gitea.com/gitea/gitea/?

@lafriks
Copy link
Member

lafriks commented Jan 16, 2020

This could be easily done with sql update with replace

@sapk
Copy link
Member

sapk commented Jan 17, 2020

@mohe2015 can you send a backport ?

@lafriks lafriks added the backport/done All backports for this PR have been created label Jan 17, 2020
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Markdown anchor links don't work
9 participants