Comments (6)
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.
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.
This is something people have been asking for. It might be good to keep everything contained in one issue: #27 .
from marked.
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.
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.
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)
- Sanatized HTML HOT 4
- Equals sign in code block breaks it HOT 1
- Setext continuation in blockquote
- URL.canParse is not a function on Brave Browser HOT 1
- Add Support for Customizable Tab Handling in Markdown Code Blocks HOT 2
- add support to node 20 HOT 1
- Docusaurus + redocusaurus == The language "shell" has no grammar HOT 4
- Issues with various Markdown aspects HOT 2
- Improved TypeScript types for TokenizerAndRendererExtension HOT 2
- Nested pre-formatted text block are not handled properly HOT 2
- When both bold and normal fonts appear in a line of text, if there is no space after the bold double asterisk, it cannot be parsed normally. HOT 1
- Text rendered in h2 heading title HOT 3
- Link and tilde symbol parsing issues detected. HOT 1
- Unable to read titles HOT 3
- marked v12 with webpack 5.9x HOT 5
- Display Github permalink to a code snippet HOT 7
- Block level extension not rendering correctly HOT 2
- Emphasis cannot be rendered
- could not resolve module HOT 4
- Support unordered lists with hyphens (-) in addition to asterisks (*) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from marked.