fix: print PDF from actual editor theme CSS and shared Markdown rendering

This commit is contained in:
2026-09-07 14:33:19 +08:00
parent 9f097ea629
commit d1cbc10fc4
20 changed files with 530 additions and 43 deletions
+2 -2
View File
@@ -476,9 +476,9 @@ def _labels_svg(geo: PlotGeometry) -> str:
return "".join(parts)
def render_svg(plot: FunctionPlot, theme_id: str = 'light') -> StaticRenderResult:
def render_svg(plot: FunctionPlot, theme_id: str = 'light', unlimited: bool = False) -> StaticRenderResult:
"""把已解析的 FunctionPlot 渲染为内嵌 SVG。"""
geo = compute_geometry(plot)
geo = compute_geometry(plot, unlimited=unlimited)
legend_height = ((len(plot.expressions) + 1) // 2) * 24
height = geo.height + legend_height
parts: list[str] = [