A mini script to markThat(==text==)
.
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.
Load the script on the page. Supports both AMD and the browser.
<script src="/path/to/markThat.js"></script>
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>.'
Alternatively, just specify a DOM element and let markThat
do the trick:
var article = document.querySelector('article');
markThat(article); // <article> has been updated
Use at your own risk.