Toggle navigation
Toggle navigation
This project
Loading...
Sign in
万朱浩
/
Venue-Ops
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
马一丁
2025-11-18 11:38:31 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
eea356f38c225a344c50e044063e60cf649f8f74
eea356f3
1 parent
90f59862
Improve Rendering Compatibility
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
ReportEngine/renderers/html_renderer.py
ReportEngine/renderers/html_renderer.py
View file @
eea356f
...
...
@@ -889,6 +889,14 @@ class HTMLRenderer:
if
handler
:
html_fragment
=
handler
(
block
)
return
self
.
_wrap_error_block
(
html_fragment
,
block
)
# 兼容旧格式:缺少type但包含inlines时按paragraph处理
if
isinstance
(
block
,
dict
)
and
block
.
get
(
"inlines"
):
html_fragment
=
self
.
_render_paragraph
({
"inlines"
:
block
.
get
(
"inlines"
)})
return
self
.
_wrap_error_block
(
html_fragment
,
block
)
# 兼容直接传入字符串的场景
if
isinstance
(
block
,
str
):
html_fragment
=
self
.
_render_paragraph
({
"inlines"
:
[{
"text"
:
block
}]})
return
self
.
_wrap_error_block
(
html_fragment
,
{
"meta"
:
{},
"type"
:
"paragraph"
})
if
isinstance
(
block
.
get
(
"blocks"
),
list
):
html_fragment
=
self
.
_render_blocks
(
block
[
"blocks"
])
return
self
.
_wrap_error_block
(
html_fragment
,
block
)
...
...
Please
register
or
login
to post a comment