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

Make pasted "img" tag has the same behavior as markdown image #31235

Merged
merged 6 commits into from
Jun 4, 2024

Conversation

wxiaoguang
Copy link
Contributor

Fix #31230

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 4, 2024
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 4, 2024
@wxiaoguang wxiaoguang added the backport/v1.22 This PR should be backported to Gitea 1.22 label Jun 4, 2024
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Jun 4, 2024
wxiaoguang and others added 2 commits June 4, 2024 13:17
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
@silverwind
Copy link
Member

Looks good, I'm surprised that no changes were needed in modules/markup/markdown/transform_image.go to avoid double link wrapping as I thought all markup elements go through html.go eventually.

@silverwind
Copy link
Member

Failure related:

--- FAIL: TestRender_CrossReferences (0.01s)
    html_test.go:119: 
        	Error Trace:	/home/runner/work/gitea/gitea/modules/markup/html_test.go:119
        	            				/home/runner/work/gitea/gitea/modules/markup/html_test.go:122
        	Error:      	Not equal: 
        	            	expected: "<p><a href=\"http://localhost:3000/gogits/gogs/issues/12345\" class=\"ref-issue\" rel=\"nofollow\">test-owner/test-repo#12345</a></p>"
        	            	actual  : "<p><a href=\"http://localhost:3000/test-owner/test-repo/issues/12345\" class=\"ref-issue\" rel=\"nofollow\">test-owner/test-repo#12345</a></p>"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -1 +1 @@
        	            	-<p><a href="http://localhost:3000/gogits/gogs/issues/12345" class="ref-issue" rel="nofollow">test-owner/test-repo#12345</a></p>
        	            	+<p><a href="http://localhost:3000/test-owner/test-repo/issues/12345" class="ref-issue" rel="nofollow">test-owner/test-repo#12345</a></p>
        	Test:       	TestRender_CrossReferences

@wxiaoguang
Copy link
Contributor Author

Failure related:

Yup, the old names are quite unclear for writing tests, so I decided to rename them by the way.

@silverwind
Copy link
Member

Ah yes, gogs name need to be removed 😆.

@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 Jun 4, 2024
@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 Jun 4, 2024
@lafriks lafriks enabled auto-merge (squash) June 4, 2024 11:52
@lafriks lafriks merged commit 9000811 into go-gitea:main Jun 4, 2024
26 checks passed
@GiteaBot GiteaBot added this to the 1.23.0 milestone Jun 4, 2024
GiteaBot pushed a commit to GiteaBot/gitea that referenced this pull request Jun 4, 2024
@GiteaBot GiteaBot added the backport/done All backports for this PR have been created label Jun 4, 2024
@wxiaoguang wxiaoguang deleted the fix-img-link branch June 4, 2024 12:30
wxiaoguang added a commit that referenced this pull request Jun 4, 2024
#31243)

Backport #31235 by wxiaoguang

Fix #31230

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jun 5, 2024
* giteaofficial/main:
  Add `lint-go-gopls` (go-gitea#30729)
  Make blockquote attention recognize more syntaxes (go-gitea#31240)
  Fix admin oauth2 custom URL settings (go-gitea#31246)
  Replace `gt-word-break` with `tw-break-anywhere` (go-gitea#31183)
  Make pasted "img" tag has the same behavior as markdown image (go-gitea#31235)
  Remove .segment from .project-column (go-gitea#31204)
  Fix overflow on push notification (go-gitea#31179)
  Fix NuGet Package API for $filter with Id equality  (go-gitea#31188)
  Fix overflow on notifications (go-gitea#31178)
  Update chroma to v2.14.0 (go-gitea#31177)
  Update air package path (go-gitea#31233)
  Bump `@github/relative-time-element` to v4.4.1 (go-gitea#31232)
silverwind added a commit to silverwind/gitea that referenced this pull request Jun 6, 2024
* origin/main: (231 commits)
  Allow including `Reviewed-on`/`Reviewed-by` lines for custom merge messages (go-gitea#31211)
  Add `MAX_ROWS` option for CSV rendering (go-gitea#30268)
  Update `golang.org/x/net` (go-gitea#31260)
  Add replacement module for `mholt/archiver` (go-gitea#31267)
  Fix Activity Page Contributors dropdown (go-gitea#31264)
  Optimize runner-tags layout to enhance visual experience (go-gitea#31258)
  fix: allow actions artifacts storage migration to complete succesfully (go-gitea#31251)
  Add `lint-go-gopls` (go-gitea#30729)
  Make blockquote attention recognize more syntaxes (go-gitea#31240)
  Fix admin oauth2 custom URL settings (go-gitea#31246)
  Replace `gt-word-break` with `tw-break-anywhere` (go-gitea#31183)
  Make pasted "img" tag has the same behavior as markdown image (go-gitea#31235)
  Remove .segment from .project-column (go-gitea#31204)
  Fix overflow on push notification (go-gitea#31179)
  Fix NuGet Package API for $filter with Id equality  (go-gitea#31188)
  Fix overflow on notifications (go-gitea#31178)
  Update chroma to v2.14.0 (go-gitea#31177)
  Update air package path (go-gitea#31233)
  Bump `@github/relative-time-element` to v4.4.1 (go-gitea#31232)
  Add option for mailer to override mail headers (go-gitea#27860)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/done All backports for this PR have been created backport/v1.22 This PR should be backported to Gitea 1.22 lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/go Pull requests that update Go code modifies/js size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Markdown image paste regressions
5 participants