Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/leeoniya/remarked.js
client-side HTML > markdown
https://github.com/leeoniya/remarked.js
Last synced: 3 days ago
JSON representation
client-side HTML > markdown
- Host: GitHub
- URL: https://github.com/leeoniya/remarked.js
- Owner: leeoniya
- Created: 2012-02-06T18:43:23.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2016-06-21T06:01:51.000Z (over 8 years ago)
- Last Synced: 2024-10-13T14:15:35.541Z (about 1 month ago)
- Language: JavaScript
- Homepage: http://leeoniya.github.io/reMarked.js/
- Size: 921 KB
- Stars: 398
- Watchers: 12
- Forks: 97
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
reMarked.js
-----------
client-side HTML > markdown _(MIT Licensed)_---
### IntroA project similar to [Markdownify](http://milianw.de/projects/markdownify/) but executed on the client. The ultimate goal is integration with existing WYSIWYG html editors (eg: Redactor, TinyMCE, CKeditor, Loki, CLeditor) to produce Markdown output. There are currently no WYSIWYG editors for markdown, only WYSIWYM, which still require knowledge of markdown syntax and its many quirky flavors.
---
### Demo: http://leeoniya.github.io/reMarked.js/![demo page](demo_th.png "demo page")
---
### Usage```js
// optional options w/defaults
var options = {
link_list: false, // render links as references, create link list as appendix
h1_setext: true, // underline h1 headers
h2_setext: true, // underline h2 headers
h_atx_suf: false, // header suffixes (###)
gfm_code: "```", // gfm code blocks
trim_code: true, // trim whitespace withinblocks (full block, not per line)
li_bullet: "*", // list item bullet style
hr_char: "-", // hr style
indnt_str: " ", // indentation string
bold_char: "*", // char used for strong
emph_char: "_", // char used for em
gfm_del: true, // ~~strikeout~~ forstrikeout
gfm_tbls: true, // markdown-extra tables
tbl_edges: false, // show side edges on tables
hash_lnks: false, // anchors w/hash hrefs as links
br_only: false, // avoid using " " as line break indicator
col_pre: "col ", // column prefix to use when creating missing headers for tables
nbsp_spc: false, // convert entities in html to regular spaces
span_tags: true, // output spans (ambiguous) using html tags
div_tags: true, // output divs (ambiguous) using html tags
unsup_tags: { // handling of unsupported tags, defined in terms of desired output style. if not listed, output = outerHTML
// no output
ignore: "script style noscript",
// eg: "some content"
inline: "span sup sub i u b center big",
// eg: "\n\n\n\tsome content\n"
block2: "div form fieldset dl header footer address article aside figure hgroup section",
// eg: "\nsome content"
block1c: "dt dd caption legend figcaption output",
// eg: "\n\nsome content"
block2c: "canvas audio video iframe"
},
tag_remap: { // remap of variants or deprecated tags to internal classes
"i": "em",
"b": "strong"
}
};var reMarker = new reMarked(options);
var markdown = reMarker.render(document.body);
```