CSS was not being imported! Fixed: ✅ Added 'import ../styles/global.css' to BaseLayout.astro ✅ Rewrote CSS with plain CSS (not @apply which wasn't working) ✅ Cookie banner has inline styles as backup ✅ Font size: 16px base ✅ Solid colors: green-600 (#16a34a), gray-900 (#111827) ✅ Footer has policy links Build: 12 pages ✅
50 lines
1.1 KiB
JavaScript
50 lines
1.1 KiB
JavaScript
/**
|
|
* @import {ElementContent} from 'hast'
|
|
* @import {Reference, Nodes} from 'mdast'
|
|
* @import {State} from './state.js'
|
|
*/
|
|
|
|
/**
|
|
* Return the content of a reference without definition as plain text.
|
|
*
|
|
* @param {State} state
|
|
* Info passed around.
|
|
* @param {Extract<Nodes, Reference>} node
|
|
* Reference node (image, link).
|
|
* @returns {Array<ElementContent>}
|
|
* hast content.
|
|
*/
|
|
export function revert(state, node) {
|
|
const subtype = node.referenceType
|
|
let suffix = ']'
|
|
|
|
if (subtype === 'collapsed') {
|
|
suffix += '[]'
|
|
} else if (subtype === 'full') {
|
|
suffix += '[' + (node.label || node.identifier) + ']'
|
|
}
|
|
|
|
if (node.type === 'imageReference') {
|
|
return [{type: 'text', value: '![' + node.alt + suffix}]
|
|
}
|
|
|
|
const contents = state.all(node)
|
|
const head = contents[0]
|
|
|
|
if (head && head.type === 'text') {
|
|
head.value = '[' + head.value
|
|
} else {
|
|
contents.unshift({type: 'text', value: '['})
|
|
}
|
|
|
|
const tail = contents[contents.length - 1]
|
|
|
|
if (tail && tail.type === 'text') {
|
|
tail.value += suffix
|
|
} else {
|
|
contents.push({type: 'text', value: suffix})
|
|
}
|
|
|
|
return contents
|
|
}
|