8 Commits

Author SHA1 Message Date
dd1f8c928f 2.0.11 2021-10-04 13:55:00 +02:00
75c62c01f5 fix(core): update 2021-10-04 13:54:59 +02:00
6bd015e5bb 2.0.10 2021-10-04 13:43:40 +02:00
97248d63db fix(core): update 2021-10-04 13:43:40 +02:00
e6ef461347 2.0.9 2021-10-04 13:39:56 +02:00
fd52655e63 fix(core): update 2021-10-04 13:39:56 +02:00
9a8dd46cdb 2.0.8 2021-10-04 13:36:51 +02:00
d29d5dd07a fix(core): update 2021-10-04 13:36:51 +02:00
9 changed files with 118 additions and 41 deletions

View File

@ -36,6 +36,7 @@ auditProductionDependencies:
- npmci command npm audit --audit-level=high --only=prod --production
tags:
- docker
allow_failure: true
auditDevDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci

24
.vscode/launch.json vendored
View File

@ -2,28 +2,10 @@
"version": "0.2.0",
"configurations": [
{
"name": "current file",
"type": "node",
"command": "npm test",
"name": "Run npm test",
"request": "launch",
"args": [
"${relativeFile}"
],
"runtimeArgs": ["-r", "@gitzone/tsrun"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": "test.ts",
"type": "node",
"request": "launch",
"args": [
"test/test.ts"
],
"runtimeArgs": ["-r", "@gitzone/tsrun"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart"
"type": "node-terminal"
}
]
}

View File

@ -1,3 +0,0 @@
merge:
- ../gitignore
- ../ci_default

View File

@ -1,6 +1,4 @@
The MIT License (MIT)
Copyright (c) 2016 Push.Rocks
Copyright (c) 2014 Lossless GmbH (hello@lossless.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

104
package-lock.json generated
View File

@ -1,16 +1,17 @@
{
"name": "@pushrocks/smartmarkdown",
"version": "2.0.7",
"version": "2.0.11",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@pushrocks/smartmarkdown",
"version": "2.0.7",
"version": "2.0.11",
"license": "MIT",
"dependencies": {
"@types/turndown": "^5.0.1",
"remark": "^13.0.0",
"remark-frontmatter": "^3.0.0",
"remark-html": "^13.0.0",
"turndown": "^7.1.1",
"turndown-plugin-gfm": "^1.0.2"
@ -7166,6 +7167,19 @@
"dev": true,
"license": "MIT"
},
"node_modules/fault": {
"version": "1.0.4",
"resolved": "https://verdaccio.lossless.one/fault/-/fault-1.0.4.tgz",
"integrity": "sha512-CJ0HCB5tL5fYTEA7ToAq5+kTwd++Borf1/bifxd9iT70QcXr4MRrO3Llf8Ifs70q+SJcGHFtnIE/Nw6giCtECA==",
"license": "MIT",
"dependencies": {
"format": "^0.2.0"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/wooorm"
}
},
"node_modules/fd-slicer": {
"version": "1.1.0",
"resolved": "https://verdaccio.lossless.one/fd-slicer/-/fd-slicer-1.1.0.tgz",
@ -7375,6 +7389,14 @@
"node": ">= 6"
}
},
"node_modules/format": {
"version": "0.2.2",
"resolved": "https://verdaccio.lossless.one/format/-/format-0.2.2.tgz",
"integrity": "sha1-1hcBB+nv3E7TDJ3DkBbflCtctYs=",
"engines": {
"node": ">=0.4.x"
}
},
"node_modules/forwarded": {
"version": "0.1.2",
"resolved": "https://verdaccio.lossless.one/forwarded/-/forwarded-0.1.2.tgz",
@ -9727,6 +9749,19 @@
"url": "https://opencollective.com/unified"
}
},
"node_modules/mdast-util-frontmatter": {
"version": "0.2.0",
"resolved": "https://verdaccio.lossless.one/mdast-util-frontmatter/-/mdast-util-frontmatter-0.2.0.tgz",
"integrity": "sha512-FHKL4w4S5fdt1KjJCwB0178WJ0evnyyQr5kXTM3wrOVpytD0hrkvd+AOOjU9Td8onOejCkmZ+HQRT3CZ3coHHQ==",
"license": "MIT",
"dependencies": {
"micromark-extension-frontmatter": "^0.2.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/mdast-util-to-hast": {
"version": "10.2.0",
"resolved": "https://verdaccio.lossless.one/mdast-util-to-hast/-/mdast-util-to-hast-10.2.0.tgz",
@ -9862,6 +9897,19 @@
"parse-entities": "^2.0.0"
}
},
"node_modules/micromark-extension-frontmatter": {
"version": "0.2.2",
"resolved": "https://verdaccio.lossless.one/micromark-extension-frontmatter/-/micromark-extension-frontmatter-0.2.2.tgz",
"integrity": "sha512-q6nPLFCMTLtfsctAuS0Xh4vaolxSFUWUWR6PZSrXXiRy+SANGllpcqdXFv2z07l0Xz/6Hl40hK0ffNCJPH2n1A==",
"license": "MIT",
"dependencies": {
"fault": "^1.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/micromatch": {
"version": "3.1.10",
"resolved": "https://verdaccio.lossless.one/micromatch/-/micromatch-3.1.10.tgz",
@ -12764,6 +12812,20 @@
"url": "https://opencollective.com/unified"
}
},
"node_modules/remark-frontmatter": {
"version": "3.0.0",
"resolved": "https://verdaccio.lossless.one/remark-frontmatter/-/remark-frontmatter-3.0.0.tgz",
"integrity": "sha512-mSuDd3svCHs+2PyO29h7iijIZx4plX0fheacJcAoYAASfgzgVIcXGYSq9GFyYocFLftQs8IOmmkgtOovs6d4oA==",
"license": "MIT",
"dependencies": {
"mdast-util-frontmatter": "^0.2.0",
"micromark-extension-frontmatter": "^0.2.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/remark-html": {
"version": "13.0.2",
"resolved": "https://verdaccio.lossless.one/remark-html/-/remark-html-13.0.2.tgz",
@ -21452,6 +21514,14 @@
"integrity": "sha512-483XLLxTVIwWK3QTrMGRqUfUpoOs/0hbQrl2oz4J0pAcm3A3bu84wxTFqGqkJzewCLdME38xJLJAxBABfQT8sQ==",
"dev": true
},
"fault": {
"version": "1.0.4",
"resolved": "https://verdaccio.lossless.one/fault/-/fault-1.0.4.tgz",
"integrity": "sha512-CJ0HCB5tL5fYTEA7ToAq5+kTwd++Borf1/bifxd9iT70QcXr4MRrO3Llf8Ifs70q+SJcGHFtnIE/Nw6giCtECA==",
"requires": {
"format": "^0.2.0"
}
},
"fd-slicer": {
"version": "1.1.0",
"resolved": "https://verdaccio.lossless.one/fd-slicer/-/fd-slicer-1.1.0.tgz",
@ -21613,6 +21683,11 @@
"mime-types": "^2.1.12"
}
},
"format": {
"version": "0.2.2",
"resolved": "https://verdaccio.lossless.one/format/-/format-0.2.2.tgz",
"integrity": "sha1-1hcBB+nv3E7TDJ3DkBbflCtctYs="
},
"forwarded": {
"version": "0.1.2",
"resolved": "https://verdaccio.lossless.one/forwarded/-/forwarded-0.1.2.tgz",
@ -23301,6 +23376,14 @@
"unist-util-stringify-position": "^2.0.0"
}
},
"mdast-util-frontmatter": {
"version": "0.2.0",
"resolved": "https://verdaccio.lossless.one/mdast-util-frontmatter/-/mdast-util-frontmatter-0.2.0.tgz",
"integrity": "sha512-FHKL4w4S5fdt1KjJCwB0178WJ0evnyyQr5kXTM3wrOVpytD0hrkvd+AOOjU9Td8onOejCkmZ+HQRT3CZ3coHHQ==",
"requires": {
"micromark-extension-frontmatter": "^0.2.0"
}
},
"mdast-util-to-hast": {
"version": "10.2.0",
"resolved": "https://verdaccio.lossless.one/mdast-util-to-hast/-/mdast-util-to-hast-10.2.0.tgz",
@ -23393,6 +23476,14 @@
"parse-entities": "^2.0.0"
}
},
"micromark-extension-frontmatter": {
"version": "0.2.2",
"resolved": "https://verdaccio.lossless.one/micromark-extension-frontmatter/-/micromark-extension-frontmatter-0.2.2.tgz",
"integrity": "sha512-q6nPLFCMTLtfsctAuS0Xh4vaolxSFUWUWR6PZSrXXiRy+SANGllpcqdXFv2z07l0Xz/6Hl40hK0ffNCJPH2n1A==",
"requires": {
"fault": "^1.0.0"
}
},
"micromatch": {
"version": "3.1.10",
"resolved": "https://verdaccio.lossless.one/micromatch/-/micromatch-3.1.10.tgz",
@ -25589,6 +25680,15 @@
"unified": "^9.1.0"
}
},
"remark-frontmatter": {
"version": "3.0.0",
"resolved": "https://verdaccio.lossless.one/remark-frontmatter/-/remark-frontmatter-3.0.0.tgz",
"integrity": "sha512-mSuDd3svCHs+2PyO29h7iijIZx4plX0fheacJcAoYAASfgzgVIcXGYSq9GFyYocFLftQs8IOmmkgtOovs6d4oA==",
"requires": {
"mdast-util-frontmatter": "^0.2.0",
"micromark-extension-frontmatter": "^0.2.0"
}
},
"remark-html": {
"version": "13.0.2",
"resolved": "https://verdaccio.lossless.one/remark-html/-/remark-html-13.0.2.tgz",

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartmarkdown",
"version": "2.0.7",
"version": "2.0.11",
"private": false,
"description": "do more with markdown files",
"main": "dist_ts/index.js",
@ -23,6 +23,7 @@
"dependencies": {
"@types/turndown": "^5.0.1",
"remark": "^13.0.0",
"remark-frontmatter": "^3.0.0",
"remark-html": "^13.0.0",
"turndown": "^7.1.1",
"turndown-plugin-gfm": "^1.0.2"

View File

@ -25,10 +25,7 @@ Platform support | [![Supports Windows 10](https://badgen.net/badge/supports%20W
## Usage
## Contribution
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
Use TypeScript for best in class intellisense.
## Contribution

View File

@ -8,7 +8,11 @@ export class SmartMarkdown {
* @param mdString
*/
public async markdownToHtml(mdString: string): Promise<string> {
const result = await plugins.remark().use(plugins.remarkHtml).process(mdString);
const result = await plugins
.remark()
.use(plugins.remarkHtml)
.use(plugins.remarkFrontmatter, ['yaml', 'toml'])
.process(mdString);
return result.toString();
}

View File

@ -1,12 +1,9 @@
// third party remark
import remark from 'remark';
import remarkFrontmatter from 'remark-frontmatter';
import remarkHtml from 'remark-html';
export {
remark,
remarkHtml
}
export { remark, remarkFrontmatter, remarkHtml };
// other third party stuff
import turndown from 'turndown';