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

Customize inline lexer #105

Closed
ForbesLindesay opened this issue Jan 5, 2013 · 12 comments
Closed

Customize inline lexer #105

ForbesLindesay opened this issue Jan 5, 2013 · 12 comments
Labels

Comments

@ForbesLindesay
Copy link
Contributor

I'd like to be able to customize the inline lexer with an additional type (specifically math). At the moment it's not extendable. There as an implementation of this in #71 but that request was closed by the OP for some reason.

@BonsaiDen
Copy link

I'd also like to see something along this line (plus a custom block lexer too).

I'm currently working on a documentation parser / generator for based on markdown formatted comments and I need to both filter out the parameter / type annotations from the token stream, as well as convert them to HTML later on.

Right now I'm using a custom patched version of marked which just utilizes a couple of callbacks and other small modifications (i.e. storing the raw text of a process nodes e.g. "storing the full "### heading title" for a heading).

@adam-p
Copy link

adam-p commented Jun 27, 2013

I figured I'd throw my use cases into my +1 for this issue as well. (Ref: adam-p/markdown-here)

  1. I've hacked math support into my copy of marked.js. It's inline-only and looks like $...$. It translates TeX into an image that uses the Google Chart API. (MathJax and MathML don't work in email.)
  2. I need to add the scheme to URLs. Some email clients can't copy with links that don't provide a scheme (MD links should automatically add scheme adam-p/markdown-here#57), so "http://" should be added at start of any such URL.

I'm sure I could come up with more examples, but those are probably representative. Some things are extensions of MD, and some things are hacks to help people use MD in the weird environment of email better.

@insanehong
Copy link
Contributor

👍

@Ognian
Copy link

Ognian commented Mar 10, 2014

Any news on this? I would need the feature of #114 . I understand that it is not added to marked but it should be possible to add it as a custom extension.

@grofit
Copy link

grofit commented Dec 4, 2014

Any news on this? I am looking for something which does basic markdown but allows me to add some custom bindings on top.

@nicbou
Copy link

nicbou commented Jan 13, 2015

I second the need for this. I patched the file to include my custom lexer, but it's far from ideal.

@PeterBocan
Copy link

Any news on this topic? I'd like to see an option to take out "$...$" and "$$...$$" to pass it to MathJax. It's like two years since the issue was opened.

@davitv
Copy link

davitv commented Nov 13, 2015

@PeterBocan , i needed same future so i added way to optionally pass custom inline and block rules with parse functions. Look at this branch

@PeterBocan
Copy link

I'll look at that! Thanks!

@nisargjhaveri
Copy link

Any news?

@davitv
Copy link

davitv commented Nov 30, 2015

Look at this branch

@joshbruce
Copy link
Member

Closing. This is not the current focus, see #1106 and #1216. Having said that, we are considering things to include in the 1.x and 2.x versions that allow more extensibility.

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

No branches or pull requests