Merge pull request #123 from velour/nerdepeida

This is my public shaming
This commit is contained in:
Scott Kiesel 2019-01-19 08:41:06 -05:00 committed by GitHub
commit c1a56f7e0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -59,15 +59,15 @@ func (p *NerdepediaPlugin) Message(message msg.Message) bool {
for scanner.Scan() { for scanner.Scan() {
line := scanner.Text() line := scanner.Text()
if description == "" { if description == "" {
index := strings.Index(line, linkPrefix) index := strings.Index(line, descriptionPrefix)
if index >= 0 { if index >= 0 {
description = html.UnescapeString(strings.TrimSuffix(strings.TrimPrefix(line, linkPrefix), closingTagSuffix)) description = html.UnescapeString(strings.TrimSuffix(strings.TrimPrefix(line, descriptionPrefix), closingTagSuffix))
} }
} }
if link == "" { if link == "" {
index := strings.Index(line, descriptionPrefix) index := strings.Index(line, linkPrefix)
if index >= 0 { if index >= 0 {
link = strings.TrimSuffix(strings.TrimPrefix(line, descriptionPrefix), closingTagSuffix) link = strings.TrimSuffix(strings.TrimPrefix(line, linkPrefix), closingTagSuffix)
} }
} }