• Stars
    star
    395
  • Rank 106,660 (Top 3 %)
  • Language
    JavaScript
  • Created over 12 years ago
  • Updated about 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

client-side HTML > markdown

reMarked.js

client-side HTML > markdown (MIT Licensed)


Intro

A project similar to 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


Usage

// 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 within <pre><code> blocks (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~~ for <del>strikeout</del>
    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 &nbsp; 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: "<tag>some content</tag>"
        inline: "span sup sub i u b center big",
        // eg: "\n\n<tag>\n\tsome content\n</tag>"
        block2: "div form fieldset dl header footer address article aside figure hgroup section",
        // eg: "\n<tag>some content</tag>"
        block1c: "dt dd caption legend figcaption output",
        // eg: "\n\n<tag>some content</tag>"
        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);

More Repositories

1

uPlot

📈 A small, fast chart for time series, lines, areas, ohlc & bars
JavaScript
8,520
star
2

uFuzzy

A tiny, efficient fuzzy search that doesn't suck
JavaScript
2,525
star
3

dropcss

An exceptionally fast, thorough and tiny unused-CSS cleaner
HTML
2,127
star
4

uDSV

A faster CSV parser in 5KB (min)
JavaScript
642
star
5

RgbQuant.js

color quantization lib
JavaScript
409
star
6

dump_r.php

a cleaner, leaner mix of print_r() and var_dump()
PHP
118
star
7

pXY.js

pixel analysis for HTML5 Canvas
JavaScript
86
star
8

preCode.js

pain killer for <pre><code> & <textarea>
JavaScript
79
star
9

transformation-matrix-js

An implementation of a 2D transformation matrix for JavaScript.
CSS
55
star
10

GIFter.js

<canvas> to GIF recorder
JavaScript
44
star
11

Route66.php

PHP micro-router
PHP
15
star
12

notyet

Lazy image & media loader
JavaScript
14
star
13

npa-nxx-miner.php

a stupid-simple NPA-NXX database > CSV miner
PHP
14
star
14

uTable

A tiny, fast UI for viewing, sorting, and filtering CSVs
TypeScript
13
star
15

uExpr

A conditional expression compiler
JavaScript
11
star
16

jquery.scanner.js

a nifty barcode scanning framework
JavaScript
8
star
17

NestedSet.php

unobtrusive MPTT / nested set and tree manip
PHP
5
star
18

handlebar.js

JS implementation of an expanded & modified (clearer?) syntax of the Mustache templating framework
JavaScript
5
star
19

domvm-widgets

Official domvm UI components
3
star
20

flecks

A lightweight CSS flexbox grid
JavaScript
2
star
21

domvm-router

JavaScript
2
star
22

matreeshka

JavaScript
2
star
23

uplot-react

TypeScript
2
star
24

what-i-like

1
star
25

PGAL.php

Payment Gateway Abstraction Layer (php5+)
1
star
26

sweetNav

more useful GPS route navigation
1
star
27

ModBoss.php

MODBUS protocol framework
1
star
28

interactive-floorplan

interactive floorplan generator for web desginers
1
star
29

Trove.php

powerful sorting, filtering and grouping for collections of objects
1
star
30

sweatshop.js

parallel processing via web workers
JavaScript
1
star
31

formation.js

flexible form generation + design framework
1
star
32

myRules

language-agnostic conditional data validation logic
1
star