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

Add id and class attr for table #393

Merged
merged 2 commits into from Oct 24, 2023
Merged

Add id and class attr for table #393

merged 2 commits into from Oct 24, 2023

Conversation

iwill
Copy link
Contributor

@iwill iwill commented Apr 27, 2023

Add id and class attr for table in Markdown:

| ID | Name   | State |
| -: | :----- | :---: |
|  1 | Task A | DONE  |
|  2 | Task B | TODO  |
{ #id .class }

HTML:

<table id="id" class="class">
   ...
</table>

@michelf
Copy link
Owner

michelf commented Apr 27, 2023

I see in the logs:

Undefined offset: 4

/home/runner/work/php-markdown/php-markdown/Michelf/MarkdownExtra.php:1199

It seems the error comes from a notice about $matches[4] when there is a table with no extra attribute block. I suggest you use the null coalescing operator ($matches[4] ?? null) to handle more cleanly cases where the regular expression finds no extra attribute block and there is no $matches[4].

@iwill
Copy link
Contributor Author

iwill commented Oct 23, 2023

@michelf Hi, I fixed the unit test error, would you like to merge this PR?

@michelf michelf merged commit 5161316 into michelf:lib Oct 24, 2023
5 checks passed
@michelf
Copy link
Owner

michelf commented Oct 24, 2023

@iwill Looks good. Sorry about it taking so long. I think GitHub never notified me about you pushing more changes.

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

Successfully merging this pull request may close these issues.

None yet

2 participants