Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.5.2 #189

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

0.5.2 #189

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17,997 changes: 3,537 additions & 14,460 deletions package-lock.json

Large diffs are not rendered by default.

111 changes: 58 additions & 53 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "md2gslides",
"version": "0.5.1",
"version": "0.5.2",
"description": "Convert Markdown to Google Slides",
"main": "index.js",
"files": [
Expand All @@ -24,7 +24,11 @@
"fix": "gts fix",
"prepare": "npm run compile",
"pretest": "npm run compile",
"posttest": "npm run lint"
"posttest": "npm run lint",
"v": "npm version patch --force",
"V": "npm version minor --force",
"version": "git add -A",
"postversion": "git push"
},
"repository": {
"type": "git",
Expand All @@ -38,84 +42,85 @@
"author": "Steven Bazyl",
"license": "Apache-2.0",
"dependencies": {
"argparse": "^2.0.0",
"@types/jsdom": "^20.0.1",
"argparse": "^2.0.1",
"await-to-js": "^3.0.0",
"babel-polyfill": "^6.26.0",
"debug": "^4.1.1",
"extend": "^3.0.0",
"debug": "^4.3.4",
"extend": "^3.0.2",
"file-url": "^3.0.0",
"google-auth-library": "^7.1.2",
"googleapis": "^78.0.0",
"highlight.js": "^10.7.3",
"google-auth-library": "^8.7.0",
"googleapis": "^109.0.1",
"highlight.js": "^11.7.0",
"inline-styles-parse": "^1.2.0",
"jsonfile": "^6.0.1",
"jsdom": "^20.0.3",
"jsonfile": "^6.1.0",
"layout": "^2.2.0",
"lodash": "^4.17.11",
"lowdb": "^1.0",
"lodash": "^4.17.21",
"lowdb": "1.0",
"lowlight": "^1.20.0",
"markdown": "^0.5.0",
"markdown-it": "^12.0.6",
"markdown-it-attrs": "^4.0.0",
"markdown-it": "^13.0.1",
"markdown-it-attrs": "^4.1.4",
"markdown-it-container": "^3.0.0",
"markdown-it-emoji": "^2.0.0",
"markdown-it-emoji": "^2.0.2",
"markdown-it-expand-tabs": "^1.0.13",
"markdown-it-fence": "^0.1.3",
"markdown-it-lazy-headers": "^0.1.3",
"markdown-it-video": "^0.6.3",
"mathjax-node": "^2.1.1",
"mime-types": "^2.1.22",
"mime-types": "^2.1.35",
"mkdirp": "^1.0.4",
"native-css": "^2.0.0",
"node-fetch": "^2.3.0",
"opener": "^1.4.2",
"node-fetch": "^2.6.7",
"opener": "^1.5.2",
"parse-color": "^1.0.0",
"parse5": "^6.0.1",
"probe-image-size": "^7.2.1",
"promise": "^8.0.3",
"parse5": "^7.1.2",
"probe-image-size": "^7.2.3",
"promise": "^8.3.0",
"promise-retry": "^2.0.1",
"request": "^2.88.0",
"request-promise-native": "^1.0.7",
"sharp": "^0.28.0",
"sharp": "^0.31.2",
"tmp": "0.2.1",
"tmp-promise": "^3.0.2",
"uuid": "^8.3.2"
"tmp-promise": "^3.0.3",
"uuid": "^9.0.0"
},
"devDependencies": {
"@babel/cli": "7.14.5",
"@babel/core": "7.14.6",
"@babel/plugin-proposal-class-properties": "7.14.5",
"@babel/preset-env": "7.14.7",
"@babel/preset-typescript": "7.14.5",
"@babel/register": "7.14.5",
"@types/chai": "^4.2.19",
"@types/chai-as-promised": "^7.1.4",
"@babel/cli": "7.19.3",
"@babel/core": "7.20.5",
"@babel/plugin-proposal-class-properties": "7.18.6",
"@babel/preset-env": "7.20.2",
"@babel/preset-typescript": "7.18.6",
"@babel/register": "7.18.9",
"@types/chai": "^4.3.4",
"@types/chai-as-promised": "^7.1.5",
"@types/chai-subset": "^1.3.3",
"@types/debug": "^4.1.5",
"@types/debug": "^4.1.7",
"@types/extend": "^3.0.1",
"@types/jsonfile": "^6.0.0",
"@types/lowdb": "1.0.10",
"@types/lowlight": "^0.0.2",
"@types/markdown-it": "12.0.2",
"@types/mkdirp": "^1.0.1",
"@types/mocha": "^8.2.2",
"@types/mock-fs": "^4.13.0",
"@types/node": "15.12.4",
"@types/parse-color": "^1.0.0",
"@types/parse5": "^6.0.0",
"@types/probe-image-size": "^7.0.0",
"@types/jsonfile": "^6.1.0",
"@types/lowdb": "^1.0.10",
"@types/lowlight": "^0.0.3",
"@types/markdown-it": "12.2.3",
"@types/mkdirp": "^1.0.2",
"@types/mocha": "^10.0.1",
"@types/mock-fs": "^4.13.1",
"@types/node": "18.11.11",
"@types/parse-color": "^1.0.1",
"@types/probe-image-size": "^7.2.0",
"@types/promise-retry": "^1.1.3",
"@types/request-promise-native": "^1.0.17",
"@types/sharp": "0.28.3",
"@types/tmp": "^0.2.0",
"@types/uuid": "^8.3.0",
"chai": "4.3.4",
"@types/request-promise-native": "^1.0.18",
"@types/sharp": "0.31.0",
"@types/tmp": "^0.2.3",
"@types/uuid": "^9.0.0",
"chai": "4.3.7",
"chai-as-promised": "7.1.1",
"chai-subset": "1.6.0",
"gts": "3.1.0",
"mocha": "9.0.1",
"mock-fs": "5.0.0",
"nock": "13.1.0",
"typescript": "4.3.4"
"gts": "^3.1.1",
"mocha": "^10.1.0",
"mock-fs": "5.2.0",
"nock": "13.2.9",
"typescript": "4.9.3"
},
"bin": {
"md2gslides": "bin/md2gslides.js"
Expand Down
2 changes: 1 addition & 1 deletion src/images/probe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async function probeUrl(url: string): Promise<ImageSize> {
return await retry(async doRetry => {
try {
return await probeImageSize(url);
} catch (err) {
} catch (err: any) {
if (retriableCodes.includes(err.code) || err.status >= 500) {
doRetry(err);
}
Expand Down
2 changes: 1 addition & 1 deletion src/layout/generic_layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ export default class GenericLayout {
};
}

protected computeShallowFieldMask<T>(object: T): string {
protected computeShallowFieldMask<T extends {}>(object: T): string {
const fields = [];
for (const field of Object.keys(object)) {
if (object[field as keyof T] !== undefined) {
Expand Down
2 changes: 1 addition & 1 deletion src/parser/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import extend from 'extend';
import * as _ from 'lodash';
import {Stylesheet} from './css';
import assert from 'assert';
import {Element} from 'parse5';
import {Element} from 'parse5/dist/tree-adapters/default';

export class Context {
public slides: SlideDefinition[] = [];
Expand Down
10 changes: 6 additions & 4 deletions src/parser/extract_slides.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
import Debug from 'debug';
import extend from 'extend';
import Token from 'markdown-it/lib/token';
import parse5, {Element} from 'parse5';
import parse5 from 'parse5';
import {Element} from 'parse5/dist/tree-adapters/default';
import fileUrl from 'file-url';
import {SlideDefinition, StyleDefinition} from '../slides';
import parseMarkdown from './parser';
Expand Down Expand Up @@ -118,9 +119,10 @@ inlineTokenRules['inline'] = (token, context) => {
};

inlineTokenRules['html_inline'] = (token, context) => {
const fragment = context.inlineHtmlContext
? parse5.parseFragment(context.inlineHtmlContext, token.content)
: parse5.parseFragment(token.content);
// const fragment = context.inlineHtmlContext
// ? parse5.parseFragment(token.content, context.inlineHtmlContext)
// : parse5.parseFragment(token.content);
const fragment = parse5.parseFragment(token.content);
if (fragment.childNodes && fragment.childNodes.length) {
const node = fragment.childNodes[0] as Element;
const style: StyleDefinition = {};
Expand Down
5 changes: 1 addition & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,5 @@
"esModuleInterop": true,
"noEmit": true
},
"include": [
"src/**/*.ts",
"test/**/*.ts"
]
"include": ["src/**/*.ts", "test/**/*.ts"]
}
Loading