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/index.js
CHANGED
|
@@ -7,7 +7,6 @@ var __export = (target, all) => {
|
|
|
7
7
|
// src/lib/gtfs-to-html.ts
|
|
8
8
|
import path from "node:path";
|
|
9
9
|
import { mkdir as mkdir2, writeFile } from "node:fs/promises";
|
|
10
|
-
import { map } from "lodash-es";
|
|
11
10
|
import { openDb as openDb2, importGtfs } from "gtfs";
|
|
12
11
|
import sanitize2 from "sanitize-filename";
|
|
13
12
|
import Timer from "timer-machine";
|
|
@@ -29,11 +28,11 @@ import {
|
|
|
29
28
|
import * as _ from "lodash-es";
|
|
30
29
|
import archiver from "archiver";
|
|
31
30
|
import beautify from "js-beautify";
|
|
31
|
+
import DOMPurify from "dompurify";
|
|
32
32
|
import { renderFile } from "pug";
|
|
33
33
|
import puppeteer from "puppeteer";
|
|
34
34
|
import sanitize from "sanitize-filename";
|
|
35
35
|
import untildify from "untildify";
|
|
36
|
-
import insane from "insane";
|
|
37
36
|
import { marked } from "marked";
|
|
38
37
|
|
|
39
38
|
// src/lib/formatters.ts
|
|
@@ -502,7 +501,7 @@ function formatTripNameForCSV(trip, timetable) {
|
|
|
502
501
|
}
|
|
503
502
|
|
|
504
503
|
// package.json
|
|
505
|
-
var version = "2.10.
|
|
504
|
+
var version = "2.10.3";
|
|
506
505
|
|
|
507
506
|
// src/lib/utils.ts
|
|
508
507
|
var isTimepoint = (stoptime) => {
|
|
@@ -2125,7 +2124,7 @@ async function renderTemplate(templateFileName, templateVars, config) {
|
|
|
2125
2124
|
const templatePath = getPathToTemplateFile(templateFileName, config);
|
|
2126
2125
|
const html = await renderFile(templatePath, {
|
|
2127
2126
|
_,
|
|
2128
|
-
md: (text) =>
|
|
2127
|
+
md: (text) => DOMPurify.sanitize(marked.parseInline(text)),
|
|
2129
2128
|
...template_functions_exports,
|
|
2130
2129
|
formatRouteColor,
|
|
2131
2130
|
formatRouteTextColor,
|
|
@@ -2188,9 +2187,8 @@ var gtfsToHtml = async (initialConfig) => {
|
|
|
2188
2187
|
warnings: []
|
|
2189
2188
|
};
|
|
2190
2189
|
const timetablePages = [];
|
|
2191
|
-
const timetablePageIds = map(
|
|
2192
|
-
|
|
2193
|
-
"timetable_page_id"
|
|
2190
|
+
const timetablePageIds = getTimetablePagesForAgency(config).map(
|
|
2191
|
+
(timetablePage) => timetablePage.timetable_page_id
|
|
2194
2192
|
);
|
|
2195
2193
|
if (config.noHead !== true && ["html", "pdf"].includes(config.outputFormat)) {
|
|
2196
2194
|
await copyStaticAssets(config, outputPath);
|