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).
- Host: GitHub
- URL: https://github.com/loup-brun/markthat.js
- Owner: loup-brun
- License: wtfpl
- Created: 2020-06-05T17:44:26.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-07T22:59:13.000Z (about 6 years ago)
- Last Synced: 2025-04-08T09:34:22.332Z (about 1 year ago)
- Topics: mark, markdown, markup
- Language: JavaScript
- Homepage:
- Size: 10.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.