-
Notifications
You must be signed in to change notification settings - Fork 85
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
Bug: Linter breaks callout with table inside #597
Comments
Thanks for reporting this. This sounds like when it recognizes the table it might not be recognizing it correctly. I will have to take a look at this as I whittle down the existing bugs. |
The same thing happens when using a math formula in display math mode in a callout or using two callouts in succession and the former one ends with a nested callout or a blockquote in it. e.g. Case 1: > [!note]
> $$\frac{1}{2}$$ will turn to > [!note]
>
> $$
\frac{1}{2}
$$ Case 2: > [!note]
> 123
> > 456
> [!info]
> abc will turn to > [!note]
> 123
>
> > 456
>
> [!info]
> abc |
@pjkaufman, I am seeing similar behaviour with just normal tables (ie outside of callouts). With Linter configured to surround tables with a blank row, the blank row is actually inserted under the table header row, when the header row is blank (the blank row should placed be above the header row): I think the underlying cause is the same so won't raise another issue. |
This definitely looks similar to some things I have worked on before, but they are also a little different. @Beau-Yang , case 1 should be fixed on master now. I just merged in a change for that which was reported last year on #560 . The other cases are a little different, so I will have to evaluate them on a case by case basis. |
This could be due to how the table regex works, but I am not sure there is a really good way to fix this. So far all of the options I have seen mean that I either get really accurate table identifications with poor performance for large files (something like 70 minutes to parse a single file) or pretty accurate table identification so long as it is standard and fills out the table parts. I have yet to find a good medium, but maybe that will be something that can be found yet. |
I am going to take another look at this. Some of these examples look like they should not be too bad to fix. However some of them look like they may not be easily done without redoing the table parser. I will see what I can do. If there is a need to update the table regex/table parsing for some of the examples, I will go ahead and break them into a separate ticket as that will be a lot of work and should not be grouped with some of the other fixes that are smaller. |
For the cases provided here, it looks like a separate change I made fixed them or at least altered them, @Beau-Yang . Here are the new results which look fine to me. Case 1 before:
after:
Case 2 before: > [!note]
> 123
> > 456
> [!info]
> abc after: > [!note]
> 123
>
> > 456
> [!info]
> abc Please let me know if for some reason the output is not valid as it looks valid to me. I made a change in the last release that seems to have fixed this (#658). |
I am still seeing this issue with the tables so I will go ahead and check it to see if there is something I can do about that n particular. Edit: Actually, I may not be seeing this issue anymore. |
I am not seeing this issue using the following markdown: | | |
| ------ | ------- |
| test1 | test2 | If you could provide me with your |
I have noticed that the following keeps getting a blank line added if you run the Linter by > [!note]
> $$
> \frac{1}{2}
> $$ becomes > [!note]
> $$
> \frac{1}{2}
>
> $$ |
@meskill , @grantx2016 , @Beau-Yang , if any of you can still reproduce this issue on the latest version of the Linter please let me know and include an example with your So barring any feedback, I plan to close this issue on next Saturday, the 15th. Thanks for helping us improve this plugin! |
@pjkaufman I'm still facing the issue with excessive an empty line after callout block. My data.json: |
I have retested with the latest version and no longer experience the issue I mentioned earlier whereby the blank line is inserted into the second row of a table, when Linter is configured to surround a table with a blank row. |
Thanks! I can now reproduce this issue. |
The rule causing the issue is "Paragraph Blank Lines" for adding empty lines around the table:
|
This seems to be a bug with how the Table is escaped leading to it not knowing if the table is a part of the blockquote or not. Thus blank lines get added. I need to think of a solution to this because it looks like fixing this breaks other things. |
I may have a fix for this, I just need to double check its results to make sure it is valid. So far it seems to work as intended. But I need to run it against a larger dataset to be sure that it does not mess things up somewhere. |
This should be fixed on master and in the next release. Please let us know if that is not the case. |
Describe the Bug
If there is a callout block with the table inside after linting, it will separate table and blockquotes and will indefinitely add new lines between callout and table.
How to Reproduce
Example to reproduce issue with
Linter Logs
Linter Config
Expected Behavior
The linter should not break the callout block
Screenshots
Device
The text was updated successfully, but these errors were encountered: