# @minna-ui/pre-markup

> Svelte markup preprocessor for use in minna-ui projects.

Latest version **0.21.0** (published 2019-02-06) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @minna-ui/pre-markup
pnpm add @minna-ui/pre-markup
yarn add @minna-ui/pre-markup
bun add @minna-ui/pre-markup
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.21.0 |
| Published | 2019-02-06 |
| First published | 2018-11-11 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 23.1 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 87 |
| Author | Max Milton |
| Maintainers | maxmilton |
| Keywords | html, minify-html, minna-ui, svelte, wearegenki |

## Links

- npm: https://www.npmjs.com/package/@minna-ui/pre-markup
- Repository: https://github.com/WeAreGenki/minna-ui/tree/master/utils/pre-markup
- Homepage: https://wearegenki.github.io/minna-ui
- Issues: https://github.com/WeAreGenki/minna-ui/issues
- npm.io page: https://npm.io/package/@minna-ui/pre-markup

## Dependencies (2)

- [deepmerge](https://npm.io/package/deepmerge.md) ^3.1.0
- [html-minifier](https://npm.io/package/html-minifier.md) 3.5.21

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 0.21.0 (latest) — 2019-02-06
- 0.22.0-next.235 (next) — 2019-03-27
- 0.22.0-next.228 — 2019-03-24
- 0.22.0-next.193 — 2019-03-10
- 0.22.0-next.190 — 2019-03-10
- 0.22.0-next.77 — 2019-02-24
- 0.20.0 — 2019-01-06
- 0.19.0 — 2018-12-23
- 0.18.1 — 2018-12-19
- 0.18.0 — 2018-12-01
- 0.17.0 — 2018-11-11

## README

[![NPM version](https://img.shields.io/npm/v/@minna-ui/pre-markup.svg)](https://www.npmjs.com/package/@minna-ui/pre-markup)
[![Licence](https://img.shields.io/npm/l/@minna-ui/pre-markup.svg)](https://github.com/WeAreGenki/minna-ui/blob/master/LICENCE)

# `@minna-ui/pre-markup`

Svelte markup preprocessor for use in [`Minna UI`](https://github.com/WeAreGenki/minna-ui) projects. Optimise HTML before it hits Svelte for smaller output. Primarily this trim excessive white space but you can enable the `unsafe` option for advanced optimisations.

## Usage

### Install

```sh
yarn add -D @minna-ui/pre-markup
```

### Quick start

Add both `@minna-ui/pre-markup` and `@minna-ui/pre-style` with default settings to your Svelte compile options:

```js
const svelte = require('svelte');
const { preprocess } = require('minna-ui');

svelte({ preprocess });
```

### Custom configuration

Add to your Svelte compile options:

```js
const svelte = require('svelte');
const preMarkup = require('@minna-ui/pre-markup');

const dev = process.env.NODE_ENV === 'development';

svelte({
  preprocess: {
    // disable for better feedback during development
    markup: preMarkup({ level: dev ? 0 : 3 }),
  },
});
```

### Known issues

**You must wrap `{}` tags in quotes when there are `{` or `}` characters inside the tag.** The exception to this is when using spread attributes (e.g. `{...child.props}`) in which case you must _not_ use quotes.

Incorrect:

<!-- prettier-ignore -->
```html
<MinnaNavbar segment={child.segment} menuItems={[
  { url: 'example', name: 'Example' },
]}/>
```

Correct (with `"` around `{ }`):

```html
<MinnaNavbar
  segment="{child.segment}"
  menuItems="{[
  { url: 'example', name: 'Example' },
]}"
/>
```

### Options

<!-- lint disable table-pipe-alignment -->
<!-- prettier-ignore -->
| Name | Default | Type | Description |
| --- | --- | --- | --- |
| unsafeWhitespace | `false` | Boolean | Collapse _all_ whitespace between tags (instead of leaving a single space). When using this option you may need to manually add spaces, `{' '}`, around inline elements such as links. |
| unsafe | `false` | Boolean | Enable aggressive and potentially dangerous optimisations. |
| `*` | `undefined` | Any | Any other options you pass in will override the default `html-minifier` options. See the [html-minifier docs](https://github.com/kangax/html-minifier) for more info. |

<!-- lint enable -->

## Licence

`@minna-ui/pre-markup` is part of [`Minna UI`](https://github.com/WeAreGenki/minna-ui), an Apache-2.0 licensed open source project. See [LICENCE](https://github.com/WeAreGenki/minna-ui/blob/master/LICENCE).

---

© 2019 [We Are Genki](https://wearegenki.com)

---
_Source: https://npm.io/package/@minna-ui/pre-markup · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
