earldouglas / codedown Goto Github PK
View Code? Open in Web Editor NEWExtract code blocks from Markdown files
License: MIT License
Extract code blocks from Markdown files
License: MIT License
Task list items is an extension of GitHub Flavored Markdown. It looks like this:
* [X] checked
* [ ] unchecked
```lang
code
```
If a Markdown document containing a task list is given to codedown
, the output incorrectly contains [
characters.
const codedown = require("codedown");
const lines = [
"* [X] checked",
"* [ ] unchecked",
"",
"```lang",
"code",
"```",
];
const input = lines.join("\n");
console.log(codedown(input, "lang"));
Expected output: code
Actual output: [[code
Sometimes you just want certain section(s) of a Markdown document, rather than the whole thing. It would be handy to be able to specify them as a list of arguments:
$ cat <file.md> | codedown <lang> [<range> [<range> ...]]
Where <range>
can be a single section, e.g. 1.6
, or a range of sections, e.g. 1.6-2.4
.
Is there a way to easily pass each codeblock to the external parser / linter instead of passing all codeblocks from a file in one go?
npm audit is failing with a moderate vulnerability, the dependency is updated in the repo, releasing new package on npm should fix this error.
=== npm audit security report ===
┌──────────────────────────────────────────────────────────────────────────────┐
│ Manual Review │
│ Some vulnerabilities require your attention to resolve │
│ │
│ Visit https://go.npm.me/audit-guide for additional guidance │
└──────────────────────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Moderate │ Regular Expression Denial of Service │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ marked │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=0.6.2 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ codedown │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ codedown > marked │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://npmjs.com/advisories/812 │
└───────────────┴──────────────────────────────────────────────────────────────┘
found 1 moderate severity vulnerability in 3 scanned packages
1 vulnerability requires manual review. See the full report for details.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.