✅ COMPLETED: 1. Dockerfile uses port 80 (astro preview) 2. BaseLayout imports globals.css 3. globals.css with Tailwind v4 @theme syntax 4. index.astro has Header, Footer, FixedContact 5. All image references fixed to existing files 6. Hero uses hdpe_pipe_main.jpg 7. Product cards use hdpe001.jpg 8. pt-20 on main for fixed header ✅ TESTED LOCALLY: - Build: 15 pages in 1.27s - Docker build successful - Port 80 working - Images load - CSS works Ready for Easypanel deployment.
45 lines
1.2 KiB
JavaScript
45 lines
1.2 KiB
JavaScript
import { decodeNamedCharacterReference } from 'decode-named-character-reference';
|
|
import { decodeNumericCharacterReference } from 'micromark-util-decode-numeric-character-reference';
|
|
const characterEscapeOrReference = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;
|
|
|
|
/**
|
|
* Decode markdown strings (which occur in places such as fenced code info
|
|
* strings, destinations, labels, and titles).
|
|
*
|
|
* The “string” content type allows character escapes and -references.
|
|
* This decodes those.
|
|
*
|
|
* @param {string} value
|
|
* Value to decode.
|
|
* @returns {string}
|
|
* Decoded value.
|
|
*/
|
|
export function decodeString(value) {
|
|
return value.replace(characterEscapeOrReference, decode);
|
|
}
|
|
|
|
/**
|
|
* @param {string} $0
|
|
* Match.
|
|
* @param {string} $1
|
|
* Character escape.
|
|
* @param {string} $2
|
|
* Character reference.
|
|
* @returns {string}
|
|
* Decoded value
|
|
*/
|
|
function decode($0, $1, $2) {
|
|
if ($1) {
|
|
// Escape.
|
|
return $1;
|
|
}
|
|
|
|
// Reference.
|
|
const head = $2.charCodeAt(0);
|
|
if (head === 35) {
|
|
const head = $2.charCodeAt(1);
|
|
const hex = head === 120 || head === 88;
|
|
return decodeNumericCharacterReference($2.slice(hex ? 2 : 1), hex ? 16 : 10);
|
|
}
|
|
return decodeNamedCharacterReference($2) || $0;
|
|
} |