fix(report): draw North Indian charts from fences after skipHtml dropped SVG

Longform report pages kept the D1/D9/Moon and varga headings but skipHtml
stripped the engine's inline SVG. Emit a jyotish-chart JSON fence beside
each SVG and render a diamond chart on the reader without relaxing HTML
sanitization. BUG-607.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jesse_Chen
2026-09-09 15:11:00 +08:00
co-authored by Cursor
parent d5972ef44a
commit 2fdcb14fd6
23 changed files with 2628 additions and 124 deletions
+64 -6
View File
@@ -3815,6 +3815,37 @@ input:not([type="radio"]):not([type="checkbox"]):not([class^="ant-"]):not([class
}
.personal-report-md-lead,
.personal-report-md-section { min-width: 0; }
.personal-report-md-article h4.personal-report-chart-heading {
margin: var(--space-5) 0 var(--space-2);
font-size: var(--type-title-sm);
font-weight: 500;
}
@media (min-width: 720px) {
/* Charts live in the eager 摘要 lead, not only later lazy H2 sections. */
.personal-report-md-lead > h4.personal-report-chart-heading:has(+ .personal-report-chart-figure),
.personal-report-md-section > h4.personal-report-chart-heading:has(+ .personal-report-chart-figure) {
float: left;
width: 50%;
box-sizing: border-box;
padding-inline: var(--space-3);
margin-top: var(--space-5);
margin-bottom: 0;
}
.personal-report-md-lead > h4.personal-report-chart-heading + .personal-report-chart-figure,
.personal-report-md-section > h4.personal-report-chart-heading + .personal-report-chart-figure {
float: left;
width: 50%;
margin-left: -50%;
margin-top: var(--space-5);
padding-top: 2.4em;
box-sizing: border-box;
max-width: none;
}
.personal-report-md-lead > .personal-report-chart-figure + :not(h4):not(.personal-report-chart-figure),
.personal-report-md-section > .personal-report-chart-figure + :not(h4):not(.personal-report-chart-figure) {
clear: both;
}
}
@media (max-width: 860px) {
.personal-report-md-layout { grid-template-columns: 1fr; }
.personal-report-toc { position: static; max-height: none; }
@@ -4092,12 +4123,22 @@ input:not([type="radio"]):not([type="checkbox"]):not([class^="ant-"]):not([class
}
.personal-report-subheading span { color: var(--color-ink-secondary); font-size: var(--type-caption); }
.personal-report-chart-svg { display: block; width: 100%; height: auto; margin-top: var(--space-4); color: var(--color-ink); }
.personal-report-chart-svg .personal-report-chart-cell { fill: none; stroke: var(--color-ink-strong); stroke-width: 1.25; }
.personal-report-chart-svg .personal-report-chart-core { fill: var(--color-canvas-muted); stroke: var(--color-ink-strong); stroke-width: 1.25; }
.personal-report-chart-svg .personal-report-chart-diamond { fill: none; stroke: var(--color-ink-strong); stroke-width: 1.25; }
.personal-report-chart-svg .personal-report-chart-cell { fill: none; stroke: var(--color-border-strong); stroke-width: 1.25; }
.personal-report-chart-svg .personal-report-chart-core { fill: var(--color-canvas-muted); stroke: var(--color-border-strong); stroke-width: 1.25; }
.personal-report-chart-svg .personal-report-chart-diamond { fill: none; stroke: var(--color-border-strong); stroke-width: 1.25; }
.personal-report-chart-svg text { fill: currentColor; }
.personal-report-chart-svg .personal-report-chart-muted { fill: var(--color-ink-tertiary); }
.personal-report-chart-figure { min-width: 0; margin: 0; }
.personal-report-chart-svg .personal-report-chart-muted { fill: var(--color-ink-muted, var(--color-ink-tertiary)); }
.personal-report-chart-figure {
min-width: 0;
max-width: 360px;
width: 100%;
margin: var(--space-4) auto var(--space-6);
}
.personal-report-chart-invalid {
margin: var(--space-3) 0;
color: var(--color-ink-muted, var(--color-ink-tertiary));
font-size: var(--type-caption);
}
.personal-report-chart-figure figcaption {
margin-top: var(--space-3);
color: var(--color-ink-tertiary);
@@ -4365,8 +4406,25 @@ input:not([type="radio"]):not([type="checkbox"]):not([class^="ant-"]):not([class
.personal-report-narrative p { font-size: 9.6pt; line-height: 1.72; orphans: 3; widows: 3; }
.personal-report-lead-grid { grid-template-columns: minmax(0, 1.04fr) minmax(64mm, .96fr); gap: 8mm; }
.personal-report-chart-svg { max-width: none; margin-top: 3mm; }
.personal-report-md-article .personal-report-chart-figure {
float: none;
width: auto;
max-width: 360px;
margin-left: auto;
margin-right: auto;
padding-top: 0;
break-inside: avoid;
}
.personal-report-md-article h4.personal-report-chart-heading {
float: none;
width: auto;
margin-left: auto;
margin-right: auto;
max-width: 360px;
padding-inline: 0;
}
.personal-report-chart-grid,
.personal-report-chart-grid.is-single { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.personal-report-chart-grid.is-single { grid-template-columns: 1fr; }
.personal-report-chart-grid.is-single { max-width: 118mm; }
.personal-report-table-wrap { max-width: none !important; overflow: visible !important; }
.personal-report-table-wrap table,