sergiocorreia / panflute

An Pythonic alternative to John MacFarlane's pandocfilters, with extra helper functions
http://scorreia.com/software/panflute/
BSD 3-Clause "New" or "Revised" License
500 stars 59 forks source link

How to skip a table? #206

Closed NMarkgraf closed 2 years ago

NMarkgraf commented 2 years ago

Hi folks,

I ran into a problem, when I wanted to get rid of tables in a (r)markdown. Usually I would simply look for a Table class a return an empty list for all children and it self. But the Caption class makes problems. Any idea how I can remove a Table?

The pan flute filter should remove only the table in the following markdown, so that this

## Some title

some text!

## The table here should be skipped

|   | Testentscheidung $H_0$ nicht verwerfen| Testentscheidung $H_0$ verwerfen  |
|:---|:---:|:---:|
| Realität: $H_0$  | Ok | **Fehler 1. Art**^[Auch $\alpha$-Fehler genannt.  Die Wahrscheinlichkeit dieses Fehlers wird durch das Signifikanzniveau nach oben beschränkt.] |
| Realität: $H_A$  | **Fehler 2. Art**^[Auch $\beta$-Fehler genannt.  Die Wahrscheinlichkeit dieses Fehlers ist schwieriger zu bestimmen, aber siehe z. B. Paket [pwr](https://cran.r-project.org/package=pwr). Bei guten Tests sinkt sie mit größerem Stichprobenumfang $n$.]  | Ok  |

## Some tile

some text!

will be handled like these:

## Some title

some text!

## The table here should be skipped

## Some tile

some text!

Anyone has a clue?

Thanks Norman

sergiocorreia commented 2 years ago

Just so I'm sure I understand, you want to skip a specific table, but the table caption is problematic? How exactly is it problematic (I can't see a table caption in your example). Also, do you want to remove the caption, keep it, or..?

jacobwhall commented 2 years ago

Hey @NMarkgraf, I may have fixed this issue with #215. Please check if v2.1.4 solves your issue. Cheers!