Coder Social home page Coder Social logo

Comments (6)

chjj avatar chjj commented on May 22, 2024

What do you mean by table? I figure you're referring to the html element, but those are considered html blocks by the lexer.

from marked.

bebraw avatar bebraw commented on May 22, 2024

Hi,

Thanks for the swift reply and sorry for being unclear. Here's an an example of what I'm talking about. I guess the GitHub guys must be using some custom table plugin.

I'm not sure if this is something you should support natively. If you think so, great. Otherwise I probably could use some nice extension mechanism to hook into the lexer to avoid certain nastiness.

from marked.

chjj avatar chjj commented on May 22, 2024

This is something people have been asking for. It might be good to keep everything contained in one issue: #27 .

from marked.

bebraw avatar bebraw commented on May 22, 2024

Gotcha.

I noticed you that had done some experiments with an extension API. Any timeline on this? I don't mind helping out a bit if you can point out how. I really wouldn't mind getting those tables to work properly. :)

from marked.

chjj avatar chjj commented on May 22, 2024

The extension API might not happen. The more I think about it, the more unrealistic it is. Take for instance the text regex for the inline rules: text: /^[^\0]+?(?=[\\<!\[_*]| {2,}\n|$)/`. If any inline rule is ever added, this regex needs to be updated accordingly to work properly. There's a lot of other little annoyances that would make it difficult. But, eventually, f I can dream up a nice clean interface to make marked extensible, without hurting performance, I will do it.

from marked.

bebraw avatar bebraw commented on May 22, 2024

Do you think some kind of hierarchical scheme would work? As I mentioned earlier tables get parsed as "paragraphs" now. If there was a way to attach another lexer to the context of paragraph it would do the trick I think.

This is sort of what I do in my current solution at ghw. I just check if the lexer gives my a text or a paragraph and then apply my rules in a certain order. Actually now that I think of it I can probably hack tables there using the same scheme. Need to give that a go to see how ugly it gets. :)

Thanks for the feedback. :)

from marked.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.