@t8/docsgen 0.2.16 → 0.2.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin.js CHANGED
@@ -139,9 +139,10 @@ function getLocation(ctx, path, preferredLocation) {
139
139
 
140
140
  // src/bin/stripHTML.ts
141
141
  var import_jsdom = require("jsdom");
142
- function stripHTML(content) {
142
+ function stripHTML(content, replaceNbsp = false) {
143
143
  try {
144
- return new import_jsdom.JSDOM(content).window.document.body.textContent;
144
+ let s = new import_jsdom.JSDOM(content).window.document.body.textContent;
145
+ return replaceNbsp ? s.replaceAll("\xA0", " ") : s;
145
146
  } catch {
146
147
  }
147
148
  }
@@ -799,8 +800,8 @@ ${getInjectedContent(ctx, "redirect", "body")}
799
800
  <head>
800
801
  <meta charset="utf-8">
801
802
  <meta name="viewport" content="width=device-width, initial-scale=1">
802
- <meta name="description" content="${escapedTitle}: ${escapeHTML(stripHTML(nav[i]?.title))}">
803
- <title>${escapeHTML(stripHTML(nav[i]?.title))} | ${escapedTitle}</title>
803
+ <meta name="description" content="${escapedTitle}: ${escapeHTML(stripHTML(nav[i]?.title, true))}">
804
+ <title>${escapeHTML(stripHTML(nav[i]?.title, true))} | ${escapedTitle}</title>
804
805
  <link rel="stylesheet" href="${cssRoot.content}/base.css">
805
806
  <link rel="stylesheet" href="${cssRoot.content}/section.css">
806
807
  ${iconTag}
@@ -39,6 +39,7 @@ main {
39
39
 
40
40
  h1 {
41
41
  font-size: 2.5em;
42
+ font-family: "Helvetica Neue", Arial, sans-serif;
42
43
  font-weight: 900;
43
44
  color: color(from var(--c1) srgb r g b / 0.75);
44
45
  margin: 1rem 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@t8/docsgen",
3
- "version": "0.2.16",
3
+ "version": "0.2.18",
4
4
  "description": "",
5
5
  "main": "dist/bin.js",
6
6
  "bin": {
@@ -166,8 +166,8 @@ ${getInjectedContent(ctx, "redirect", "body")}
166
166
  <head>
167
167
  <meta charset="utf-8">
168
168
  <meta name="viewport" content="width=device-width, initial-scale=1">
169
- <meta name="description" content="${escapedTitle}: ${escapeHTML(stripHTML(nav[i]?.title))}">
170
- <title>${escapeHTML(stripHTML(nav[i]?.title))} | ${escapedTitle}</title>
169
+ <meta name="description" content="${escapedTitle}: ${escapeHTML(stripHTML(nav[i]?.title, true))}">
170
+ <title>${escapeHTML(stripHTML(nav[i]?.title, true))} | ${escapedTitle}</title>
171
171
  <link rel="stylesheet" href="${cssRoot.content}/base.css">
172
172
  <link rel="stylesheet" href="${cssRoot.content}/section.css">
173
173
  ${iconTag}
@@ -1,7 +1,9 @@
1
1
  import { JSDOM } from "jsdom";
2
2
 
3
- export function stripHTML(content: string) {
3
+ export function stripHTML(content: string, replaceNbsp = false) {
4
4
  try {
5
- return new JSDOM(content).window.document.body.textContent;
5
+ let s = new JSDOM(content).window.document.body.textContent;
6
+
7
+ return replaceNbsp ? s.replaceAll("\xa0", " ") : s;
6
8
  } catch {}
7
9
  }
package/src/css/index.css CHANGED
@@ -39,6 +39,7 @@ main {
39
39
 
40
40
  h1 {
41
41
  font-size: 2.5em;
42
+ font-family: "Helvetica Neue", Arial, sans-serif;
42
43
  font-weight: 900;
43
44
  color: color(from var(--c1) srgb r g b / 0.75);
44
45
  margin: 1rem 0;