Skip to content

Is it possible to add custom rules? #717

Closed

Description

@boop5

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>

Activity

  1. MarkusPint commented on Feb 22, 2016

    @MarkusPint

    +1

  2. thisboyiscrazy commented on Feb 22, 2016

    @thisboyiscrazy

    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.

  3. benfrain commented on Feb 24, 2016

    @benfrain

    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>
    
  4. auser commented on Apr 20, 2016

    @auser

    +1

  5. joshbruce commented on Dec 23, 2017

    @joshbruce
    Member

    Closing to consolidate issues.

  6. KostyaTretyak commented on Jan 6, 2018

    @KostyaTretyak
    Contributor

    Hi guys. Look at this library.

  7. added this to the milestone on Jan 6, 2018
  8. joshbruce commented on Jan 6, 2018

    @joshbruce
    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.

  9. modified the milestones: , v1.x - All the nope release on Apr 4, 2018
  10. joshbruce commented on Apr 13, 2018

    @joshbruce
    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions