Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version 2.0 is not published #3

Closed
chemzqm opened this issue May 12, 2014 · 5 comments
Closed

version 2.0 is not published #3

chemzqm opened this issue May 12, 2014 · 5 comments

Comments

@chemzqm
Copy link

chemzqm commented May 12, 2014

https://www.npmjs.org/package/markit

I'm wondering why highlight is not working, then I got this.

@lepture
Copy link
Owner

lepture commented May 12, 2014

use marked please. marked has merged renderer feature.

@minwe
Copy link

minwe commented Jan 14, 2015

@lepture Could you tell me how to use custom renderer method in marked?

Like blockcode in markedjs/marked#129.

var markd = require('marked');

var renderer = new markd.Renderer();

renderer.blockcode = function(code, lang) {
  return 'test blockcode renderer method';
};

console.log(markd('`````html\n<div></div>`````', {
  gfm: true,
  tables: true,
  breaks: false,
  pedantic: true,
  sanitize: false,
  smartLists: true,
  renderer: renderer
}));

It not works.

@lepture
Copy link
Owner

lepture commented Jan 14, 2015

@minwe use marked please. This repo exists because marked didn't merge the features that time. But marked has them all now.

@lepture lepture closed this as completed Jan 14, 2015
@minwe
Copy link

minwe commented Jan 14, 2015

@lepture I just want to know how to get lang with custom syntax like Nico.

For example, I write markdown like this:

var mdString  = '`````html<div>some html code</div>`````';

var marked = require('marked');

var renderer = new markd.Renderer();

renderer.code = function(code, lang) {
  console.log(lang);
  return 'test blockcode renderer method';
};

console.log(marked(mdString, {
  gfm: true,
  tables: true,
  breaks: false,
  pedantic: true,
  sanitize: false,
  smartLists: true,
  renderer: renderer
}));

In Nico, lang is return html-, so I can set code as insert HTML, but in marked, lang is always html, I can't tell it is code or inserted HTML.

Could you tell me what is the key point that you got it in Nico.
Thanks very much.

@minwe
Copy link

minwe commented Jan 14, 2015

@lepture I found it in Nico's source code.

text = text.replace(/^`````([\w\:]+)$/gm, '`````$1-');

Sorry for trouble you. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants