gtfs-to-html 2.10.1 → 2.10.3
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/app/index.js +5 -7
- package/dist/app/index.js.map +1 -1
- package/dist/bin/gtfs-to-html.js +5 -7
- package/dist/bin/gtfs-to-html.js.map +1 -1
- package/dist/index.js +5 -7
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/views/default/css/timetable_styles.css +24 -12
- package/views/default/formatting_functions.pug +19 -0
- package/views/default/timetable_horizontal.pug +2 -1
- package/views/default/timetable_vertical.pug +2 -1
package/dist/bin/gtfs-to-html.js
CHANGED
|
@@ -26,11 +26,11 @@ import {
|
|
|
26
26
|
import * as _ from "lodash-es";
|
|
27
27
|
import archiver from "archiver";
|
|
28
28
|
import beautify from "js-beautify";
|
|
29
|
+
import DOMPurify from "dompurify";
|
|
29
30
|
import { renderFile } from "pug";
|
|
30
31
|
import puppeteer from "puppeteer";
|
|
31
32
|
import sanitize from "sanitize-filename";
|
|
32
33
|
import untildify from "untildify";
|
|
33
|
-
import insane from "insane";
|
|
34
34
|
import { marked } from "marked";
|
|
35
35
|
|
|
36
36
|
// src/lib/formatters.ts
|
|
@@ -499,7 +499,7 @@ function formatTripNameForCSV(trip, timetable) {
|
|
|
499
499
|
}
|
|
500
500
|
|
|
501
501
|
// package.json
|
|
502
|
-
var version = "2.10.
|
|
502
|
+
var version = "2.10.3";
|
|
503
503
|
|
|
504
504
|
// src/lib/utils.ts
|
|
505
505
|
var isTimepoint = (stoptime) => {
|
|
@@ -2147,7 +2147,7 @@ async function renderTemplate(templateFileName, templateVars, config) {
|
|
|
2147
2147
|
const templatePath = getPathToTemplateFile(templateFileName, config);
|
|
2148
2148
|
const html = await renderFile(templatePath, {
|
|
2149
2149
|
_,
|
|
2150
|
-
md: (text) =>
|
|
2150
|
+
md: (text) => DOMPurify.sanitize(marked.parseInline(text)),
|
|
2151
2151
|
...template_functions_exports,
|
|
2152
2152
|
formatRouteColor,
|
|
2153
2153
|
formatRouteTextColor,
|
|
@@ -2177,7 +2177,6 @@ async function renderPdf(htmlPath) {
|
|
|
2177
2177
|
// src/lib/gtfs-to-html.ts
|
|
2178
2178
|
import path from "node:path";
|
|
2179
2179
|
import { mkdir as mkdir2, writeFile } from "node:fs/promises";
|
|
2180
|
-
import { map } from "lodash-es";
|
|
2181
2180
|
import { openDb as openDb2, importGtfs } from "gtfs";
|
|
2182
2181
|
import sanitize2 from "sanitize-filename";
|
|
2183
2182
|
import Timer from "timer-machine";
|
|
@@ -2217,9 +2216,8 @@ var gtfsToHtml = async (initialConfig) => {
|
|
|
2217
2216
|
warnings: []
|
|
2218
2217
|
};
|
|
2219
2218
|
const timetablePages = [];
|
|
2220
|
-
const timetablePageIds = map(
|
|
2221
|
-
|
|
2222
|
-
"timetable_page_id"
|
|
2219
|
+
const timetablePageIds = getTimetablePagesForAgency(config).map(
|
|
2220
|
+
(timetablePage) => timetablePage.timetable_page_id
|
|
2223
2221
|
);
|
|
2224
2222
|
if (config.noHead !== true && ["html", "pdf"].includes(config.outputFormat)) {
|
|
2225
2223
|
await copyStaticAssets(config, outputPath);
|