An open API service indexing awesome lists of open source software.

https://github.com/loup-brun/markthat.js

A dumb little script to markThat(text).
https://github.com/loup-brun/markthat.js

mark markdown markup

Last synced: about 2 months ago
JSON representation

A dumb little script to markThat(text).

Awesome Lists containing this project

README

          

# markThat.js

A mini script to `markThat(==text==)`.

## What’s this?

So you want to use the `==` fences for declaring the [HTML `` element](https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-mark-element) in Markdown, but your rendering engine wouldn’t support it?
This little guy’s got you covered.

## Install

Load the script on the page.
Supports both AMD and the browser.

```html

```

## Usage

### Method 1: String

```js
var text = 'Some HTML text that I want to ==mark==.';
var article = document.querySelector('article');

// Update the DOM yourself
article.innerHTML = markThat(text); // 'Some HTML text that I want to mark.'
```

### Method 2: DOM element

Alternatively, just specify a DOM element and let `markThat` do the trick:

```js
var article = document.querySelector('article');

markThat(article); // has been updated
```

## License

[WTFPL](http://www.wtfpl.net/txt/copying/)

Use at your own risk.