Debug: add console.log to renderCalloutTag, set title color as inline style

Helps diagnose why title row is not showing. Logging shows the raw tag
data and whether the title branch is taken. Inline style bypasses any
CSS custom-property cascade issues.

https://claude.ai/code/session_01UP8Wo2CKPNhvvTkzX48CWF
This commit is contained in:
Claude 2026-05-17 18:08:37 +00:00
parent b626d5e066
commit dd306b004c
No known key found for this signature in database

View file

@ -1815,6 +1815,7 @@ function fmtDatetime(dtStr) {
}; };
function renderCalloutTag(container, tag) { function renderCalloutTag(container, tag) {
console.log('[mdcms callout] tag:', tag.tagName, '| options:', JSON.stringify(tag.options), '| body:', (tag.body || '').slice(0, 60));
var typeMatch = tag.tagName.match(/^callout-(info|warning|success|error)$/); var typeMatch = tag.tagName.match(/^callout-(info|warning|success|error)$/);
var calloutType = typeMatch ? typeMatch[1] : 'info'; var calloutType = typeMatch ? typeMatch[1] : 'info';
@ -1823,6 +1824,7 @@ function fmtDatetime(dtStr) {
var title = opts.title || null; var title = opts.title || null;
var iconName = opts.icon || null; var iconName = opts.icon || null;
var bodyMd = tag.body || ''; var bodyMd = tag.body || '';
console.log('[mdcms callout] title =', JSON.stringify(title), '| msgKey =', msgKey);
// Resolve message: key — config.yml callouts block // Resolve message: key — config.yml callouts block
if (msgKey) { if (msgKey) {
@ -1861,13 +1863,17 @@ function fmtDatetime(dtStr) {
container.style.setProperty('--callout-bg', hexToRgba(bgColour, 0.08)); container.style.setProperty('--callout-bg', hexToRgba(bgColour, 0.08));
if (title) { if (title) {
console.log('[mdcms callout] creating title row:', title);
var titleRow = document.createElement('div'); var titleRow = document.createElement('div');
titleRow.className = 'mdcms-callout-title'; titleRow.className = 'mdcms-callout-title';
titleRow.style.color = primaryColour; // bypass CSS var cascade
titleRow.appendChild(iconEl(iconName)); titleRow.appendChild(iconEl(iconName));
var titleText = document.createElement('span'); var titleText = document.createElement('span');
titleText.textContent = title; titleText.textContent = title;
titleRow.appendChild(titleText); titleRow.appendChild(titleText);
container.appendChild(titleRow); container.appendChild(titleRow);
} else {
console.log('[mdcms callout] no title — skipping title row');
} }
if (bodyMd) { if (bodyMd) {