coderaiser / minify

Minifier of js, css, html and img
https://coderaiser.github.io/minify
MIT License
228 stars 29 forks source link

Can you also support mifinfy a markdown .md file? #110

Closed bestian closed 1 year ago

bestian commented 1 year ago

type: feature scope: markdown subject: Can you also support mifinfy a markdown .md file?

something like this:

function minifyMd(content) {
    // Remove extra whitespace
    let minified = content.replace(/\s+/g, ' ');
    // Remove unnecessary line breaks
    minified = minified.replace(/\n /g, '\n').replace(/ \n/g, '\n');
    return minified;
}
coderaiser commented 1 year ago

That’s a good idea for a PR :)

coderaiser commented 1 year ago

Actually as I see, what you want is not minifier for markdown, but rather linter, you can use 🐊Putout to lint JavaScript inside your markdown files

bestian commented 1 year ago

Thanks for your reply so soon,

But the function is only an example of the parser

Not the input part.

Let me explain the feature I actually requested:

input:

## Foo
Bar
Baz

Output:

## Foo Bar Baz
coderaiser commented 1 year ago

Code examples you provided has different meaning and they render differently:

Foo

Bar Baz

Foo Bar Baz

How it’s related to minification, and first provided example? To lint JavaScript inside markdown use 🐊Putout.