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

Is it possible to add custom rules? #717

Closed
boop5 opened this issue Feb 8, 2016 · 8 comments
Closed

Is it possible to add custom rules? #717

boop5 opened this issue Feb 8, 2016 · 8 comments

Comments

@boop5
Copy link

boop5 commented Feb 8, 2016

I want to add some custom rules like

{item=12345}(foo bar)

which should translate to something like

<span class="item" data-item="12345">foo bar</span>
@MarkusPint
Copy link

+1

@thisboyiscrazy
Copy link

Looking at the code it doesn't seem like it the tokenizer and parser are hard coded if statements.

I did it by first parsing what I needed first using regexs then passing the rest to marked.

It seems like being able to add custom rules would slow it down and marked seems written for speed.

It would also be a nice feature.

@benfrain
Copy link

Came here looking for the same. In a similar fashion I'm hoping to convert this in markdown:

I> Here is an info box

To:

<aside class="info">Here is an info box</aside>

@auser
Copy link

auser commented Apr 20, 2016

+1

@joshbruce
Copy link
Member

Closing to consolidate issues.

@KostyaTretyak
Copy link
Contributor

Hi guys. Look at this library.

@joshbruce joshbruce added this to the 0.6.0 - Improve developer experience milestone Jan 6, 2018
@joshbruce
Copy link
Member

My only two cents at the moment are:

  1. This could be interesting from the perspective that writing to match a spec could be "easier", because we could use that capability to match the spec.

  2. Is that a direction Marked should go? Essentially letting users create their own Markdown specification...if I'm understanding the proposal properly. (Product Owner perspective says it could be a differentiater in the marketplace.) This is kind of what I've done with 8fold Component and 8fold Elements...but I made it two different libraries. One to handle the lowest level - translating elements. And the other to implement the HTML specification.

@joshbruce joshbruce reopened this Jan 6, 2018
@joshbruce joshbruce modified the milestones: 0.6.0 - Improve developer experience, v1.x - All the nope release Apr 4, 2018
@joshbruce
Copy link
Member

Closing as not considered part of the current focus.

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

No branches or pull requests

7 participants