/markThat.js

A dumb little script to markThat(text).

Primary LanguageJavaScriptDo What The F*ck You Want To Public LicenseWTFPL

markThat.js

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

What’s this?

So you want to use the == fences for declaring the HTML <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.

<script src="/path/to/markThat.js"></script>

Usage

Method 1: String

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>mark</mark>.'

Method 2: DOM element

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

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

markThat(article); // <article> has been updated

License

WTFPL

Use at your own risk.