(Node node, int depth)
| 505 | private boolean remove = false; |
| 506 | |
| 507 | @Override |
| 508 | public FilterResult head(Node node, int depth) { |
| 509 | if (node instanceof Comment) { |
| 510 | String data = ((Comment) node).getData().trim(); |
| 511 | if (data.startsWith("[if") && !data.endsWith("endif]")) { |
| 512 | remove = true; |
| 513 | return FilterResult.REMOVE; |
| 514 | } else if (remove && data.endsWith("endif]")) { |
| 515 | remove = false; |
| 516 | return FilterResult.REMOVE; |
| 517 | } |
| 518 | } |
| 519 | return (remove ? FilterResult.REMOVE : FilterResult.CONTINUE); |
| 520 | } |
| 521 | |
| 522 | @Override |
| 523 | public FilterResult tail(Node node, int depth) { |
no test coverage detected