-
Notifications
You must be signed in to change notification settings - Fork 100
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
Add Table Tag Support: #32
base: master
Are you sure you want to change the base?
Conversation
Translate Markdown : titleA|titleB|titleC|titleD ---|---|---|---|--- a|b|c|d 1|2|3|4 ... To Html: <table> <thead> <tr> <th>titleA</th> <th>titleB</th> <th>titleC</th> <th>titleD</th> </tr> </thead> <tbody> <tr> <td>a</td> <td>b</td> <td>c</td> <td>d</td> </tr> <tr> <td>1</td> <td>2</td> <td>3</td> <td>4</td> </tr> </tbody> </table>
After a quick look, I do have some major concerns:
|
Thanks for your reply,and something I want to know:
|
@@ -296,6 +296,12 @@ public LineType getLineType(final Configuration configuration) | |||
return LineType.BQUOTE; | |||
} | |||
|
|||
if(this.leading == 0 && this.value.matches("(.+\\|)+.+") && this.next != null && this.next.value != null && this.next.value.matches("(-+\\|)*-*")){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Table in Markdown may be better to be like
title1 | title2 |
---|---|
value1 | value2 |
It's easy to parse and more pretty
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please refer: https://www.tablesgenerator.com/markdown_tables to generator markdown table.
The first line and second line should be:
| Tables | Are | Cool |
|----------|:-------------:|------:|
if (this.leading == 0 && this.value.matches("^\\|(.+\\|)+.+\\|$")){
// First Line Looks Like: | Tables | Are | Cool |
if (this.next != null && this.next.value != null && this.next.value.matches("^\\|(-|:|\\|)+\\|$")) {
// Second Line Looks Like: |----------|:-------------:|------:|
return LineType.TABLE;
}
}
Translate Markdown :
To Html: