Skip to content

A dumb little script to markThat(text).

License

Notifications You must be signed in to change notification settings

loup-brun/markThat.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

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.

About

A dumb little script to markThat(text).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published