Skip to content

Commit 636cdba

Browse files
committed
Fix unclosed annotation span in EncodingVisualizer
1 parent f7db48f commit 636cdba

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

bindings/python/py_src/tokenizers/tools/visualizer.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,11 @@ def __make_html(text: str, encoding: Encoding, annotations: AnnotationList) -> s
314314
encoding=encoding,
315315
)
316316
)
317+
318+
# Close any remaining open annotation span
319+
if cur_anno_ix is not None:
320+
spans.append("</span>")
321+
317322
res = HTMLBody(spans) # Send the list of spans to the body of our html
318323
return res
319324

0 commit comments

Comments
 (0)