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

Use media links for img in post-process #10515

Merged
merged 3 commits into from
Feb 28, 2020

Conversation

zeripath
Copy link
Contributor

@zeripath zeripath commented Feb 27, 2020

during the change to goldmark the relative links in markdown images were supported. This PR fixes the post-processor to do relative links for embedded html

Fix #8830
Fixes #10484
Fixes #10506
Fixes #11482

@zeripath zeripath added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Feb 27, 2020
@zeripath zeripath added this to the 1.12.0 milestone Feb 27, 2020
@zeripath
Copy link
Contributor Author

zeripath commented Feb 27, 2020

There is an issue in that imgs inside <a> are not munged at present because we can't detect if their text is already munged - I will have a think, I suspect it's quite simple that we don't run textNode processor once we're inside a link Done

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 27, 2020
@guillep2k guillep2k added issue/regression Issue needs no code to be fixed, only a description on how to fix it yourself and removed issue/regression Issue needs no code to be fixed, only a description on how to fix it yourself labels Feb 27, 2020
@guillep2k
Copy link
Member

Now I don't know if this is kind/regression or not.... 🤔

@6543
Copy link
Member

6543 commented Feb 27, 2020

I'll test ...
(code lgtm but I can't be 100% sure since I had to look up al the func I dont know jet)

Copy link
Member

@6543 6543 left a comment

Choose a reason for hiding this comment

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

works lige a charm - thx goldmark

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Feb 27, 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. labels Feb 28, 2020
@codecov-io
Copy link

Codecov Report

Merging #10515 into master will decrease coverage by 0.02%.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10515      +/-   ##
==========================================
- Coverage   43.68%   43.66%   -0.03%     
==========================================
  Files         586      586              
  Lines       81494    81496       +2     
==========================================
- Hits        35601    35583      -18     
- Misses      41481    41499      +18     
- Partials     4412     4414       +2
Impacted Files Coverage Δ
routers/repo/commit.go 29.04% <0%> (ø) ⬆️
models/action.go 48.82% <0%> (ø) ⬆️
routers/repo/attachment.go 47.57% <0%> (ø) ⬆️
modules/markup/common/linkify.go 34.69% <0%> (ø) ⬆️
models/notification.go 63.55% <0%> (-0.85%) ⬇️
models/issue_comment.go 46.68% <100%> (+0.18%) ⬆️
models/attachment.go 57.3% <100%> (ø) ⬆️
services/pull/temp_repo.go 29.05% <0%> (-5.13%) ⬇️
services/pull/check.go 50% <0%> (-3.05%) ⬇️
modules/git/command.go 86.95% <0%> (-2.61%) ⬇️
... and 6 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 2d52f02...0054e69. Read the comment docs.

@guillep2k guillep2k merged commit 9ad2aa8 into go-gitea:master Feb 28, 2020
@zeripath zeripath deleted the media-for-img branch February 28, 2020 08:17
zeripath added a commit to zeripath/gitea that referenced this pull request May 19, 2020
* use media links for img in post-process

* do not visit text of anchors
@zeripath zeripath added backport/v1.11 backport/done All backports for this PR have been created labels May 19, 2020
techknowlogick pushed a commit that referenced this pull request May 19, 2020
* use media links for img in post-process

* do not visit text of anchors
@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/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
5 participants