# ultramarked

> Marked with built-in syntax highlighting and input sanitizing that doesn't encode all HTML

Latest version **1.7.0** (published 2014-11-11) · 0 weekly downloads

## Install

```sh
npm install ultramarked
pnpm add ultramarked
yarn add ultramarked
bun add ultramarked
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.7.0 |
| Published | 2014-11-11 |
| First published | 2013-06-19 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Known vulnerabilities | 0 (+5 in 3 direct dependencies) |
| Install scripts | no |
| Author | Nicolas Bevacqua |
| Maintainers | bevacqua |

## Links

- npm: https://www.npmjs.com/package/ultramarked
- Repository: https://github.com/bevacqua/ultramarked
- Issues: https://github.com/bevacqua/ultramarked/issues
- npm.io page: https://npm.io/package/ultramarked

## Dependencies (7)

- [he](https://npm.io/package/he.md) ^0.4.1
- [chalk](https://npm.io/package/chalk.md) ^0.4.0
- [marked](https://npm.io/package/marked.md) ^0.3.2
- [wordwrap](https://npm.io/package/wordwrap.md) 0.0.2
- [highlight.js](https://npm.io/package/highlight.js.md) ^8.0.0
- [highlight-redux](https://npm.io/package/highlight-redux.md) ^1.0.1
- [underscore.string](https://npm.io/package/underscore.string.md) ^2.3.3

## Recent versions

- 1.7.0 (latest) — 2014-11-11
- 1.6.3 — 2014-11-09
- 1.6.2 — 2014-11-05
- 1.6.1 — 2014-11-03
- 1.6.0 — 2014-10-24
- 1.5.4 — 2014-10-21
- 1.5.3 — 2014-10-03
- 1.5.2 — 2014-10-03
- 1.5.1 — 2014-09-30
- 1.5.0 — 2014-09-18
- 1.4.3 — 2014-09-11
- 1.4.2 — 2014-09-10
- 1.4.1 — 2014-09-10
- 1.4.0 — 2014-09-10
- 1.3.1 — 2014-09-04
- … 16 more at https://npm.io/package/ultramarked/versions

## README

# ultramarked

[**Marked**](https://github.com/chjj/marked) with built-in syntax highlighting and input sanitizing that doesn't encode all HTML.

**Ultramarked** wraps around marked, so it's essentially Marked, with a few extra options.

## Fetch

    $ npm install ultramarked --save

## Use

    var ultramarked = require('ultramarked');

    ultramarked.setOptions({
        // your options go here
    });

    ultramarked('This is **awesome**!');

## Configure

### options.ultralight

Syntax highlighting powered by [highlight.js](https://github.com/isagalaev/highlight.js), no extra magic. Classes are prefixed `hljs` for convenience. Note that the `renderer` you choose will be overridden.

### options.ultrasanitize

As of right now, Marked encodes **all** HTML input when `sanitize = true`. Set this option to true to use the [AngularJS Sanitizer][2] sanitizer, tweaked to disallow script and style tags.

### options.iframes

If you are using `ultrasanitize`, you can pass in an array of strings or regular expressions that match permitted `iframe` targets. Regular expressions are tested against user input, and strings are interpreted as the beginning of a URL. This means that an string like `'http://google.com'` will match any URL in the `google.com` domain that uses the `HTTP` protocol.

### options.terminal

Prettifies the code for terminal output! Incompatible with `ultralight`, which will be disabled when `terminal` is enabled. Also turns off `ultrasanitize`, because color codes. Luckily none of that will be an issue when rendering HTML for the terminal!

![terminal.png][1]

### options.sanitizer

Angular's sanitizer option might be too lenient for you. If that's the case, you can use PageDown's white-list instead, which is much more narrow, and doesn't allow setting class attributes, for example.

```js
ultramarked.setOptions({
	sanitizer: require('pagedown-sanitizer')
});
```

[1]: http://i.imgur.com/fTh1JiD.png
[2]: https://github.com/angular/angular.js/blob/master/lib/htmlparser/htmlparser.js

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