-
-
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
Update Goldmark to Goldmark 1.4.4 #18420
Conversation
Signed-off-by: Andrew Thornton <[email protected]>
CI fail is unrelated, but still needs to be resolved (probably for another PR though). Probably due to recent update to golangci-lint |
It's related, goldmark just deprecated |
who does deprecation in revision release :/ |
I'll fix the deprecations later today. I'll block this until then. |
Lol even the file that this is deeply inspired by hasn't migrated from the deprecated function. |
damn this is not a simple update and will require test cases - would it be ok to simply nolint this? |
Signed-off-by: Andrew Thornton <[email protected]>
Could we use another function? |
It would be a refactor ... @lunny - I can have a look in this -> ok the diff will be bigger than 5lines :D |
The issue is in footnoteBlockParser: func (b *footnoteBlockParser) Open(parent ast.Node, reader text.Reader, pc parser.Context) (ast.Node, parser.State) {
line, segment := reader.PeekLine()
pos := pc.BlockOffset()
if pos < 0 || line[pos] != '[' {
return nil, parser.NoChildren
}
pos++
if pos > len(line)-1 || line[pos] != '^' {
return nil, parser.NoChildren
}
open := pos + 1
closes := 0
closure := util.FindClosure(line[pos+1:], '[', ']', false, false) //nolint
closes = pos + 1 + closure
next := closes + 1
if closure > -1 {
if next >= len(line) || line[next] != ':' {
return nil, parser.NoChildren
}
} else {
return nil, parser.NoChildren
}
... This doesn't easily appear to map to the reader.FindClosure() code - as in the above the reader position appears to be at the start of the line so would need to be advanced to the pos and then reset as necessary. So we'd need to write a couple of test cases to ensure that the code does the correct job if we were to refactor this to get rid of the deprecation. |
ps: I can accept that we use |
If that, I'm OK to merge it at first. But I think we have to resolve it in future version when the function will be removed. |
Codecov Report
@@ Coverage Diff @@
## main #18420 +/- ##
==========================================
- Coverage 46.03% 46.01% -0.02%
==========================================
Files 840 842 +2
Lines 92856 93186 +330
==========================================
+ Hits 42746 42883 +137
- Misses 43323 43502 +179
- Partials 6787 6801 +14
Continue to review full report at Codecov.
|
Backport go-gitea#18420 * nolint the deprecation Signed-off-by: Andrew Thornton <[email protected]>
Backport #19120 Backport #19099 Backport #18874 Backport #18420 Backport #19128 Backport #18270 Bump to build with go1.18 Co-authored-by: techknowlogick <[email protected]> Signed-off-by: Andrew Thornton <[email protected]> Co-authored-by: silverwind <[email protected]> Co-authored-by: 6543 <[email protected]> Co-authored-by: zeripath <[email protected]> Co-authored-by: Jelle Hulter <[email protected]>
* Update Goldmark to Goldmark 1.4.4 * nolint the deprecation Signed-off-by: Andrew Thornton <[email protected]>
Update Goldmark libraries.
I've put a PR in to goldmark-highlight that should update it to use the latest chroma.
Signed-off-by: Andrew Thornton [email protected]