mirror of
https://github.com/kbenestad/mdcms.git
synced 2026-06-18 15:24:32 +00:00
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:
parent
b626d5e066
commit
dd306b004c
1 changed files with 6 additions and 0 deletions
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue