diff --git a/lib/packages/docutils/highlite.nim b/lib/packages/docutils/highlite.nim index f8376f46c3..7542b88018 100644 --- a/lib/packages/docutils/highlite.nim +++ b/lib/packages/docutils/highlite.nim @@ -301,6 +301,8 @@ proc nimNextToken(g: var GeneralTokenizer, keywords: openArray[string] = @[]) = g.kind = nimGetKeyword(id) elif isKeyword(keywords, id) >= 0: g.kind = gtKeyword + else: + g.kind = gtIdentifier of '0': inc(pos) case g.buf[pos] diff --git a/tests/stdlib/trstgen.nim b/tests/stdlib/trstgen.nim index 6253e7146d..ae980afd80 100644 --- a/tests/stdlib/trstgen.nim +++ b/tests/stdlib/trstgen.nim @@ -1629,8 +1629,8 @@ suite "RST/Code highlight": """ - let expected = """

def f_name(arg=42): - print(f"{arg}")

""" + let expected = """

def f_name(arg=42): + print(f"{arg}")

""" check strip(rstToHtml(pythonCode, {}, newStringTable(modeCaseSensitive))) == strip(expected)