Skip to content

Commit

Permalink
markdown generation revamp
Browse files Browse the repository at this point in the history
* Fix the spacing for the implicit line breaks in odt
* Improve debuggability of markdown generation
  • Loading branch information
ggodlewski authored Apr 11, 2024
1 parent 79974ad commit b15eab5
Show file tree
Hide file tree
Showing 71 changed files with 2,674 additions and 22,046 deletions.
377 changes: 317 additions & 60 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
"relateurl": "0.2.7",
"sharp": "0.32.6",
"sharp-phash": "^2.0.0",
"slugify": "1.6.5",
"slugify": "1.6.6",
"stream": "^0.0.2",
"ts-node": "10.9.2",
"typescript": "5.3.3",
Expand Down Expand Up @@ -137,7 +137,7 @@
"@typescript-eslint/eslint-plugin": "6.12.0",
"@typescript-eslint/parser": "6.12.0",
"chai": "5.0.0",
"diff": "5.0.0",
"diff": "5.2.0",
"eslint": "8.54.0",
"husky": "7.0.4",
"jshint": "2.13.4",
Expand Down
2 changes: 1 addition & 1 deletion src/containers/google_folder/UserConfigService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {FileContentService} from '../../utils/FileContentService.ts';
import {HugoTheme} from '../server/routes/ConfigController.ts';
import {FRONTMATTER_DUMP_OPTS} from '../transform/frontmatters/frontmatter.ts';
import {DEFAULT_ACTIONS} from '../action/ActionRunnerContainer.ts';
import {RewriteRule} from '../../odt/applyRewriteRule.js';
import {RewriteRule} from '../../odt/applyRewriteRule.ts';

async function execAsync(command: string) {
const err = new Error();
Expand Down
4 changes: 2 additions & 2 deletions src/google/markdownToHtml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ export async function markdownToHtml(buffer: Buffer): Promise<string> {
const html = marked.parse(md, { pedantic: false, hooks: {
preprocess: (markdown: string) => markdown,
postprocess(html: string) {
const style = '<style>\n.code { font-family: Courier; }\n</style>\n';
return `<html>\n<head>\n<meta content="text/html; charset=UTF-8" http-equiv="content-type" />\n${style}</head>\n<body>\n${html}\n</body>\n</html>\n`;
const style = '<style>\n.code { font-family: Courier, serif; }\n</style>\n';
return `<html>\n<head>\n<meta content="text/html; charset=UTF-8" http-equiv="content-type" />\n${style}</head>\n<body>\n${html.trim()}\n</body>\n</html>\n`;
}
}
});
Expand Down
Loading

0 comments on commit b15eab5

Please sign in to comment.