Skip to content

Commit

Permalink
fix unused args
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksandr Rulev committed Mar 17, 2024
1 parent 90257bf commit adb6ce2
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions pkg/md/jirawiki/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,22 +147,22 @@ func secondPass(lines []string) string {
if token, ok := tokenStarts(beg, tokens); ok {
switch token.family {
case typeTagTextEffect:
end = token.handleTextEffects(runes, &out, beg)
end = token.handleTextEffects(runes, &out)
case typeTagHeading:
end = token.handleHeadings(runes, &out, beg)
end = token.handleHeadings(runes, &out)
case typeTagInlineQuote:
end = token.handleInlineBlockQuote(runes, &out, beg)
end = token.handleInlineBlockQuote(runes, &out)
case typeTagList:
end = token.handleList(runes, &out, beg)
end = token.handleList(runes, &out)
case typeTagFencedCode:
lineNum, end = token.handleFencedCodeBlock(lineNum, lines, &out, beg)
if lineNum >= len(lines) {
break out
}
case typeTagReferenceLink:
end = token.handleReferenceLink(runes, &out, beg)
end = token.handleReferenceLink(runes, &out)
case typeTagTable:
end = token.handleTable(runes, &out, beg)
end = token.handleTable(runes, &out)
case typeTagOther:
if token.tag == TagQuote {
// If end is same as size of the input, it implies that
Expand Down Expand Up @@ -370,7 +370,7 @@ type Token struct {
endIdx int
}

func (t *Token) handleTextEffects(runes []rune, out *strings.Builder, beg int) int {
func (t *Token) handleTextEffects(runes []rune, out *strings.Builder) int {
word := string(runes[t.startIdx+1 : t.endIdx])
effectChar := string(runes[t.startIdx])
effectReplacement, exists := replacements[effectChar]
Expand All @@ -387,7 +387,7 @@ func (t *Token) handleTextEffects(runes []rune, out *strings.Builder, beg int) i
return t.endIdx
}

func (t *Token) handleHeadings(runes []rune, out *strings.Builder, beg int) int {
func (t *Token) handleHeadings(runes []rune, out *strings.Builder) int {
headingLevel := strings.Repeat("#", utf8.RuneCountInString(string(runes[t.startIdx:t.endIdx+1])))

if runes[t.endIdx+1] != ' ' {
Expand All @@ -401,7 +401,7 @@ func (t *Token) handleHeadings(runes []rune, out *strings.Builder, beg int) int
return len(runes) - 1
}

func (t *Token) handleInlineBlockQuote(runes []rune, out *strings.Builder, beg int) int {
func (t *Token) handleInlineBlockQuote(runes []rune, out *strings.Builder) int {
quoteText := string(runes[t.endIdx+1:])

out.WriteString(fmt.Sprintf("\n%s", replacements[t.tag]))
Expand All @@ -410,7 +410,7 @@ func (t *Token) handleInlineBlockQuote(runes []rune, out *strings.Builder, beg i
return t.endIdx + utf8.RuneCountInString(quoteText)
}

func (t *Token) handleList(runes []rune, out *strings.Builder, beg int) int {
func (t *Token) handleList(runes []rune, out *strings.Builder) int {
end := t.endIdx + 1

for i := 0; i < t.startIdx; i++ {
Expand Down Expand Up @@ -466,7 +466,7 @@ func (t *Token) handleFencedCodeBlock(idx int, lines []string, out *strings.Buil
return i + 1, 0
}

func (t *Token) handleReferenceLink(runes []rune, out *strings.Builder, runeIndex int) int {
func (t *Token) handleReferenceLink(runes []rune, out *strings.Builder) int {
runesLength := len(runes)

if t.startIdx+1 > runesLength || t.endIdx > runesLength || t.startIdx+1 > t.endIdx {
Expand All @@ -488,7 +488,7 @@ func (t *Token) handleReferenceLink(runes []rune, out *strings.Builder, runeInde
return t.endIdx
}

func (t *Token) handleTable(runes []rune, out *strings.Builder, runeIndex int) int {
func (t *Token) handleTable(runes []rune, out *strings.Builder) int {
line := string(runes)

if len(runes) < 2 || runes[1] != '|' {
Expand Down

0 comments on commit adb6ce2

Please sign in to comment.