Browse Source

Options rename

pull/14/head
Vitaly Puzrin 10 years ago
parent
commit
892460ed0b
  1. 2
      README.md
  2. 2
      benchmark/implementations/current/index.js
  3. 2
      benchmark/profile.js
  4. 2
      demo/assets/index.js
  5. 2
      demo/index.jade
  6. 2
      demo/sample.js
  7. 4
      lib/defaults.js
  8. 2
      lib/renderer.js
  9. 2
      lib/rules_block/blockquote.js
  10. 2
      lib/rules_block/list.js
  11. 2
      lib/rules_inline/emphasis.js
  12. 2
      lib/rules_inline/links.js
  13. 2
      support/specsplit.js
  14. 2
      test/remarkable.js
  15. 2
      test/remarked.js
  16. 2
      test/stmd.js

2
README.md

@ -36,7 +36,7 @@ var md = new Remarkable({
html: false, // enable html tags in source html: false, // enable html tags in source
xhtml: false, // use '/' to close single tags (<br />) xhtml: false, // use '/' to close single tags (<br />)
breaks: true, // convert '\n' in paragraphs into <br> breaks: true, // convert '\n' in paragraphs into <br>
langprefix: 'language-', // css language prefix for fenced blocks langPrefix: 'language-', // css language prefix for fenced blocks
// Should return HTML markup for highlighted text, // Should return HTML markup for highlighted text,
// or empty string to escape source // or empty string to escape source

2
benchmark/implementations/current/index.js

@ -5,7 +5,7 @@ var md = new Remarkable({
html: true, html: true,
xhtml: true, xhtml: true,
breaks: false, breaks: false,
langprefix: 'language-' langPrefix: 'language-'
}); });
exports.run = function(data) { exports.run = function(data) {

2
benchmark/profile.js

@ -10,7 +10,7 @@ var md = new Remarkable({
html: true, html: true,
xhtml: true, xhtml: true,
breaks: false, breaks: false,
langprefix: 'language-' langPrefix: 'language-'
}); });
var data = fs.readFileSync(path.join(__dirname, '/samples/cdata.md'), 'utf8'); var data = fs.readFileSync(path.join(__dirname, '/samples/cdata.md'), 'utf8');

2
demo/assets/index.js

@ -7,7 +7,7 @@
html: true, html: true,
xhtml: true, xhtml: true,
breaks: false, breaks: false,
langprefix: 'language-', langPrefix: 'language-',
// options below are for demo only // options below are for demo only
_highlight: false, _highlight: false,

2
demo/index.jade

@ -45,7 +45,7 @@ html
input#_highlight(type='checkbox') input#_highlight(type='checkbox')
| highlight | highlight
.form-group .form-group
input#langprefix.form-control._tip( input#langPrefix.form-control._tip(
type='input' type='input'
placeholder='language prefix' placeholder='language prefix'
title='css class language prefix for fenced code blocks' title='css class language prefix for fenced code blocks'

2
demo/sample.js

@ -3,7 +3,7 @@ var md = new Remarkable({
html: false, // enable html tags in source html: false, // enable html tags in source
xhtml: false, // use '/' to close single tags (<br />) xhtml: false, // use '/' to close single tags (<br />)
breaks: true, // convert '\n' in paragraphs into <br> breaks: true, // convert '\n' in paragraphs into <br>
langprefix: 'language-', // css language prefix for fenced blocks langPrefix: 'language-', // css language prefix for fenced blocks
// Should return HTML markup for highlighted text, // Should return HTML markup for highlighted text,
// or empty string to escape source // or empty string to escape source

4
lib/defaults.js

@ -7,7 +7,7 @@ module.exports = {
html: false, html: false,
xhtml: false, xhtml: false,
breaks: false, breaks: false,
level: 10, maxLevel: 20,
langprefix: 'language-', langPrefix: 'language-',
highlight: function (/*str*/) { return ''; } highlight: function (/*str*/) { return ''; }
}; };

2
lib/renderer.js

@ -54,7 +54,7 @@ rules.code = function (tokens, idx /*, options*/) {
rules.fence = function (tokens, idx, options) { rules.fence = function (tokens, idx, options) {
var token = tokens[idx]; var token = tokens[idx];
var langClass = ''; var langClass = '';
var langPrefix = options.langprefix || ''; var langPrefix = options.langPrefix || '';
var params, langName = ''; var params, langName = '';
var highlighted; var highlighted;

2
lib/rules_block/blockquote.js

@ -17,7 +17,7 @@ module.exports = function blockquote(state, startLine, endLine, silent) {
// check the block quote marker // check the block quote marker
if (state.src.charCodeAt(pos++) !== 0x3E/* > */) { return false; } if (state.src.charCodeAt(pos++) !== 0x3E/* > */) { return false; }
if (state.level >= state.options.level) { return false; } if (state.level >= state.options.maxLevel) { return false; }
// we know that it's going to be a valid blockquote, // we know that it's going to be a valid blockquote,
// so no point trying to find the end of it in silent mode // so no point trying to find the end of it in silent mode

2
lib/rules_block/list.js

@ -101,7 +101,7 @@ module.exports = function list(state, startLine, endLine, silent) {
return false; return false;
} }
if (state.level >= state.options.level) { return false; } if (state.level >= state.options.maxLevel) { return false; }
// We should terminate list on style change. Remember first one to compare. // We should terminate list on style change. Remember first one to compare.
markerCharCode = state.src.charCodeAt(posAfterMarker - 1); markerCharCode = state.src.charCodeAt(posAfterMarker - 1);

2
lib/rules_inline/emphasis.js

@ -124,7 +124,7 @@ module.exports = function emphasis(state/*, silent*/) {
return true; return true;
} }
if (state.level >= state.options.level) { return false; } if (state.level >= state.options.maxLevel) { return false; }
oldLength = state.tokens.length; oldLength = state.tokens.length;
oldPending = state.pending; oldPending = state.pending;

2
lib/rules_inline/links.js

@ -28,7 +28,7 @@ function links(state) {
} }
if (marker !== 0x5B/* [ */) { return false; } if (marker !== 0x5B/* [ */) { return false; }
if (state.level >= state.options.level) { return false; } if (state.level >= state.options.maxLevel) { return false; }
labelStart = start + 1; labelStart = start + 1;
labelEnd = parseLinkLabel(state, start); labelEnd = parseLinkLabel(state, start);

2
support/specsplit.js

@ -61,7 +61,7 @@ readFile(options.spec, 'utf8', function (error, input) {
html: true, html: true,
breaks: false, breaks: false,
xhtml: true, xhtml: true,
langprefix: 'language-' langPrefix: 'language-'
}); });
if (error) { if (error) {

2
test/remarkable.js

@ -12,7 +12,7 @@ var Remarked = require('../');
describe('Default', function () { describe('Default', function () {
var md = new Remarked({ var md = new Remarked({
breaks: false, breaks: false,
langprefix: '' langPrefix: ''
}); });
utils.addTests(path.join(__dirname, 'fixtures/remarkable'), md); utils.addTests(path.join(__dirname, 'fixtures/remarkable'), md);

2
test/remarked.js

@ -15,7 +15,7 @@ describe('remarked', function () {
// Set options, to give output more close to remarked // Set options, to give output more close to remarked
md.set({ md.set({
breaks: false, breaks: false,
langprefix: 'lang-' langPrefix: 'lang-'
}); });
utils.addTests(path.join(__dirname, 'fixtures/remarked_ok'), md); utils.addTests(path.join(__dirname, 'fixtures/remarked_ok'), md);

2
test/stmd.js

@ -14,7 +14,7 @@ describe('stmd', function () {
html: true, html: true,
xhtml: true, xhtml: true,
breaks: false, breaks: false,
langprefix: 'language-' langPrefix: 'language-'
}); });
utils.addSpecTests(path.join(__dirname, 'fixtures/stmd/good.txt'), md); utils.addSpecTests(path.join(__dirname, 'fixtures/stmd/good.txt'), md);

Loading…
Cancel
Save