|
@ -63,7 +63,13 @@ var md = new Remarkable({ |
|
|
breaks: false, // Convert '\n' in paragraphs into <br> |
|
|
breaks: false, // Convert '\n' in paragraphs into <br> |
|
|
langPrefix: 'language-', // CSS language prefix for fenced blocks |
|
|
langPrefix: 'language-', // CSS language prefix for fenced blocks |
|
|
linkify: false, // Autoconvert URL-like text to links |
|
|
linkify: false, // Autoconvert URL-like text to links |
|
|
typographer: false, // Enable smartypants and other sweet transforms |
|
|
|
|
|
|
|
|
// Enable some language-neutral replacement + quotes beautification |
|
|
|
|
|
typographer: false, |
|
|
|
|
|
|
|
|
|
|
|
// Double + single quotes replacement pairs, when typographer enabled, |
|
|
|
|
|
// and smartquotes on. Set doubles to '«»' for Russian, '„“' for German. |
|
|
|
|
|
quotes: '“”‘’', |
|
|
|
|
|
|
|
|
// Highlighter function. Should return escaped HTML, |
|
|
// Highlighter function. Should return escaped HTML, |
|
|
// or '' if the source string is not changed |
|
|
// or '' if the source string is not changed |
|
@ -195,21 +201,27 @@ provides coverage for the most common and universal use cases: |
|
|
|
|
|
|
|
|
```js |
|
|
```js |
|
|
var Remarkable = require('remarkable'); |
|
|
var Remarkable = require('remarkable'); |
|
|
var md = new Remarkable({ typographer: true }); |
|
|
var md = new Remarkable({ |
|
|
|
|
|
typographer: true, |
|
|
|
|
|
quotes: '“”‘’' |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
// Actual default values |
|
|
// Disable rules at all: |
|
|
md.typographer.set({ |
|
|
md.core.ruler.disable([ 'replacements', 'smartquotes' ]); |
|
|
singleQuotes: '‘’', // set empty to disable |
|
|
|
|
|
doubleQuotes: '“”', // set '«»' for Russian, '„“' for German, empty to disable |
|
|
// Actual default replacements: |
|
|
copyright: true, // (c) (C) → © |
|
|
// |
|
|
trademark: true, // (tm) (TM) → ™ |
|
|
// '' → ‘’ |
|
|
registered: true, // (r) (R) → ® |
|
|
// "" → “”. Set '«»' for Russian, '„“' for German, empty to disable |
|
|
plusminus: true, // +- → ± |
|
|
// (c) (C) → © |
|
|
paragraph: true, // (p) (P) -> § |
|
|
// (tm) (TM) → ™ |
|
|
ellipsis: true, // ... → … (also ?.... → ?.., !.... → !..) |
|
|
// (r) (R) → ® |
|
|
dupes: true, // ???????? → ???, !!!!! → !!!, `,,` → `,` |
|
|
// +- → ± |
|
|
dashes: true // -- → –, --- → — |
|
|
// (p) (P) -> § |
|
|
}) |
|
|
// ... → … (also ?.... → ?.., !.... → !..) |
|
|
|
|
|
// ???????? → ???, !!!!! → !!!, `,,` → `,` |
|
|
|
|
|
// -- → –, --- → — |
|
|
|
|
|
// |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
Of course, you can also add your own rules or replace the defaults with something |
|
|
Of course, you can also add your own rules or replace the defaults with something |
|
@ -250,14 +262,12 @@ reconfigure anyone as you wish. Render also can be modified and extended. See |
|
|
source code to understand details. Pay attention to these properties: |
|
|
source code to understand details. Pay attention to these properties: |
|
|
|
|
|
|
|
|
```js |
|
|
```js |
|
|
|
|
|
Remarkable.core |
|
|
|
|
|
Remarkable.core.ruler |
|
|
Remarkable.block |
|
|
Remarkable.block |
|
|
Remarkable.block.ruler |
|
|
Remarkable.block.ruler |
|
|
Remarkable.inline |
|
|
Remarkable.inline |
|
|
Remarkable.inline.ruler |
|
|
Remarkable.inline.ruler |
|
|
Remarkable.typographer |
|
|
|
|
|
Remarkable.typographer.ruler |
|
|
|
|
|
Remarkable.linkifier |
|
|
|
|
|
Remarkable.linkifier.ruler |
|
|
|
|
|
Remarkable.renderer |
|
|
Remarkable.renderer |
|
|
Remarkable.renderer.rules |
|
|
Remarkable.renderer.rules |
|
|
``` |
|
|
``` |
|
|