diff --git a/lexer.go b/lexer.go index fe50d92..f4bda94 100644 --- a/lexer.go +++ b/lexer.go @@ -150,6 +150,7 @@ func (l *Lexer) next() rune { } func (l *Lexer) run() { + defer l.chanMutex.Unlock() for state := lexText; state != nil; { state = state(l) } diff --git a/states.go b/states.go index 6725eb0..f76f686 100644 --- a/states.go +++ b/states.go @@ -2,6 +2,8 @@ package wikilink import ( "strings" + + "go.uber.org/zap" ) func isOpenLink(s string) bool { @@ -27,6 +29,9 @@ func isBlockRef(s string) bool { func lexIdent(l *Lexer) stateFn { for { r := l.next() + l.L.Named("lexIdent").Debug("stepping through lexIdent", + zap.String("r", string(r)), + ) s := l.input[l.GetPos():] if r == '\\' { // i think this will handle escape characters? break