From 413873560ad26df0c67188c0673f65bd50e2092c Mon Sep 17 00:00:00 2001 From: Eamonn de Leastar Date: Tue, 12 Sep 2023 08:46:38 +0100 Subject: [PATCH] fix: port over markdown null check + remove spruios import of firebase --- cli/tutors-gen-lib/package.json | 2 +- cli/tutors-gen-lib/src/models/markdown-utils.ts | 6 +++--- cli/tutors-gen-lib/src/tutors.ts | 2 +- cli/tutors-publish-html/package.json | 4 ++-- cli/tutors-publish/package.json | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cli/tutors-gen-lib/package.json b/cli/tutors-gen-lib/package.json index 055709895..5cdf7556a 100644 --- a/cli/tutors-gen-lib/package.json +++ b/cli/tutors-gen-lib/package.json @@ -1,6 +1,6 @@ { "name": "tutors-gen-lib", - "version": "3.2.0", + "version": "3.2.3", "description": "Library for tutors generators", "scripts": { "build": "tsc --build", diff --git a/cli/tutors-gen-lib/src/models/markdown-utils.ts b/cli/tutors-gen-lib/src/models/markdown-utils.ts index 21ef8ce92..baa7b3d44 100644 --- a/cli/tutors-gen-lib/src/models/markdown-utils.ts +++ b/cli/tutors-gen-lib/src/models/markdown-utils.ts @@ -17,7 +17,6 @@ import footnote from "markdown-it-footnote"; // @ts-ignore import deflist from "markdown-it-deflist"; import type { Course } from "./lo-types"; -import { browserLocalPersistence } from "firebase/auth"; const markdownIt: any = new MarkdownIt({ html: false, // Enable HTML tags in source @@ -34,13 +33,13 @@ const markdownIt: any = new MarkdownIt({ } catch (__) {} } return '
' + markdownIt.utils.escapeHtml(str) + "
"; - } + }, }); const tocOptions = { includeLevel: [1, 2, 3] }; markdownIt.use(latex); markdownIt.use(anchor, { - permalink: anchor.permalink.headerLink() + permalink: anchor.permalink.headerLink(), }); markdownIt.use(toc, tocOptions); @@ -99,6 +98,7 @@ export function convertLabToHtml(course: Course, lab: Lab) { } export function convertLoToHtml(course: Course, lo: Lo) { + if (!lo.contentMd) return; if (lo.type === "lab") { convertLabToHtml(course, lo as Lab); } else { diff --git a/cli/tutors-gen-lib/src/tutors.ts b/cli/tutors-gen-lib/src/tutors.ts index 783c40e85..ef4049b17 100644 --- a/cli/tutors-gen-lib/src/tutors.ts +++ b/cli/tutors-gen-lib/src/tutors.ts @@ -5,7 +5,7 @@ import { resourceBuilder } from "./generator/resource-builder"; import { writeFile } from "./generator/file-utils"; import { generateNetlifyToml } from "./generator/netlify"; -export const version = "3.2.0"; +export const version = "3.2.3"; export function parseCourse(folder: string): Course { resourceBuilder.buildTree(folder); diff --git a/cli/tutors-publish-html/package.json b/cli/tutors-publish-html/package.json index e8f3f272a..e15df6a85 100644 --- a/cli/tutors-publish-html/package.json +++ b/cli/tutors-publish-html/package.json @@ -1,6 +1,6 @@ { "name": "tutors-publish-html", - "version": "3.2.0", + "version": "3.2.3", "description": "Static course web site generator - html emitter", "main": "./src/tutors-publish-html.js", "scripts": { @@ -24,7 +24,7 @@ "nunjucks": "^3.2.3", "path": "^0.12.7", "shelljs": "^0.8.5", - "tutors-gen-lib": "^3.2.0" + "tutors-gen-lib": "^3.2.3" }, "devDependencies": { "prettier": "2.8.4", diff --git a/cli/tutors-publish/package.json b/cli/tutors-publish/package.json index 17c9142be..4cd596a4c 100644 --- a/cli/tutors-publish/package.json +++ b/cli/tutors-publish/package.json @@ -1,6 +1,6 @@ { "name": "tutors-publish", - "version": "3.2.0", + "version": "3.2.3", "description": "Static course web site generator - json emitter", "main": "./src/tutors-publish.js", "scripts": { @@ -17,7 +17,7 @@ "tutors-publish": "./src/tutors-publish.js" }, "dependencies": { - "tutors-gen-lib": "^3.2.0" + "tutors-gen-lib": "^3.2.3" }, "devDependencies": { "prettier": "2.8.8",