.+))/;
+ return rules
+ .filter(({ selectors }) => selectors && !selectors.includes(":root"))
+ .map((rule) => {
+ return Object.assign(rule, {
+ declarations: rule.declarations.map((declaration) => {
+ let { key, val } = CSS_VAR.exec(declaration.value).groups;
+ // only one level of variable referencing is supported
+ key = CSS_VAR.exec(options[key] || defaultVariables[key]).groups.key || key;
+ return Object.assign(declaration, {
+ value: key ? options[key] || defaultVariables[key] : declaration.value,
+ });
+ }),
+ });
+ });
+}
diff --git a/gmi-web.css b/gmi-web.css
index 2611503..048d8c4 100644
--- a/gmi-web.css
+++ b/gmi-web.css
@@ -1,4 +1,4 @@
-@import ("gmi.css");
+@import "gmi.css";
img,
audio,
@@ -48,6 +48,7 @@ video {
--ul-family: var(--serif);
--ul-size: var(--p-size);
--ul-height: 1.25;
+ --ul-style: circle;
--quote-family: var(--serif);
--quote-size: var(--p-size);
@@ -73,7 +74,7 @@ a {
font-size: var(--a-size);
font-style: var(--a-style);
font-family: var(--serif);
- line-height: var(--a-line-height);
+ line-height: var(--a-height);
text-decoration: var(--a-decoration);
}
@@ -136,7 +137,7 @@ pre::selection {
}
blockquote {
- border-left: 0.5rem solid var(--foreground);
+ border-color: var(--foreground);
}
pre,
@@ -162,7 +163,7 @@ a:hover {
}
blockquote {
- border-left: 0.5rem solid var(--background);
+ border-color: var(--background);
}
pre,
diff --git a/html.js b/html.js
index 02d5b01..644f0c8 100644
--- a/html.js
+++ b/html.js
@@ -42,21 +42,21 @@ export function block(
exts.some((ext) => new RegExp(`\.${ext}$`).test(url));
if (options.image && matchesExt(href, options.image)) {
type = "img";
- props += ` src=${href}` + alt ? ` title=${alt}` : "";
+ props += ` src="${href}"` + alt ? ` title="${alt}"` : "";
} else if (options.audio && matchesExt(href, options.audio)) {
type = "audio";
- props += ` controls src=${href}` + alt ? ` title=${alt}` : "";
+ props += ` controls src="${href}"` + alt ? ` title="${alt}"` : "";
} else if (options.video && matchesExt(href, options.video)) {
type = "video";
- props += ` controls src=${href}` + alt ? ` title=${alt}` : "";
+ props += ` controls src="${href}"` + alt ? ` title="${alt}"` : "";
} else {
type = "a";
content = title || href;
- props += ` href=${href}`;
+ props += ` href="${href}"`;
}
}
if (options.body || options.inline)
- content !== "" ? (props += CSS.inline(type, options)) : "";
+ content !== "" ? (props += CSS.inline(options, type)) : "";
return `<${type}${props}>${escape(content)}${type}>`;
}
@@ -68,7 +68,7 @@ export function body(tokens, options) {
if (cursor.pre) {
blocks.push(
``
);
const closing = tokens.findIndex((token) => token.pre);
@@ -77,9 +77,7 @@ export function body(tokens, options) {
tokens = tokens.slice(closing + 1);
} else if (cursor.li) {
blocks.push(
- `
`
+ ``
);
const closing = tokens.findIndex((token) => !token.li);
blocks = blocks
@@ -100,17 +98,19 @@ export function toHTML(gemtext, options) {
if (options.body) return body(tokens, options);
+ console.log(options)
return `
-
+
${head(
Object.assign(options, {
title: tokens[0].h1,
description: description(tokens, options),
})
)}
-
+
${body(tokens, options)}
@@ -160,7 +160,6 @@ export function streamHTML(options) {
toHTML(file.contents.toString("utf-8"), options)
);
file.path = file.path.replace(GMI_EXT, ".html");
- if (options.verbose) console.log(file.path);
return cb(null, file);
});
}