From 9d92e575bd0eda98aa6d4bcfce6eafecf043f512 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Wed, 20 Nov 2024 18:46:11 -0500 Subject: [PATCH] fix: fix html escape in the notebook --- dargs/notebook.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dargs/notebook.py b/dargs/notebook.py index dce5f77..c60c366 100644 --- a/dargs/notebook.py +++ b/dargs/notebook.py @@ -19,6 +19,7 @@ from __future__ import annotations +import html import json import re from typing import Any @@ -249,7 +250,7 @@ def print_html(self, _level=0, _last_one=True): else: raise ValueError(f"Unknown type: {type(self.arg)}") - doc_body = self.arg.doc.strip() + doc_body = html.escape(self.arg.doc.strip()) if doc_body: buff.append("
") doc_body = re.sub(r"""\n+""", "\n", doc_body)