-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 bug of link query order on markdown render #14156
Conversation
@lunny need to change tests:
|
no - don't change the tests - fix the query parameter it's not escaping properly. |
e8b65f9
to
e67dd5c
Compare
The first test should be right and I changed the bluemonday codes. I also changed the second test on this PR because it should be a wrong test. html_test.go:143
Error: Not equal:
expected: "<p><a href=\"magnet:?dn=download&xt=urn%3Abtih%3A5dee65101db281ac9c46344cd6b175cdcadabcde\" rel=\"nofollow\">magnet:?xt=urn:btih:5dee65101db281ac9c46344cd6b175cdcadabcde&dn=download</a></p>"
actual : "<p><a href=\"magnet:?xt=urn:btih:5dee65101db281ac9c46344cd6b175cdcadabcde&dn=download\" rel=\"nofollow\">magnet:?xt=urn:btih:5dee65101db281ac9c46344cd6b175cdcadabcde&dn=download</a></p>"
Diff:
--- Expected
+++ Actual
@@ -1 +1 @@
-<p><a href="magnet:?dn=download&xt=urn%3Abtih%3A5dee65101db281ac9c46344cd6b175cdcadabcde" rel="nofollow">magnet:?xt=urn:btih:5dee65101db281ac9c46344cd6b175cdcadabcde&dn=download</a></p>
+<p><a href="magnet:?xt=urn:btih:5dee65101db281ac9c46344cd6b175cdcadabcde&dn=download" rel="nofollow">magnet:?xt=urn:btih:5dee65101db281ac9c46344cd6b175cdcadabcde&dn=download</a></p>
Test: TestRender_links It's obvious, the query order changed but should not. |
Codecov Report
@@ Coverage Diff @@
## master #14156 +/- ##
==========================================
- Coverage 42.36% 42.02% -0.34%
==========================================
Files 728 733 +5
Lines 78015 78666 +651
==========================================
+ Hits 33049 33059 +10
- Misses 39540 40179 +639
- Partials 5426 5428 +2
Continue to review full report at Codecov.
|
* Fix bug of link query order on markdown render * Fix bluemonday bug and fix one wrong test Co-authored-by: 6543 <6543@obermui.de>
Should fix #14090
We temporarily use a replace on go.mod before microcosm-cc/bluemonday#105 merged.