mirror of
https://github.com/jgm/pandoc.git
synced 2026-10-01 03:45:51 +00:00
- Improve parsing of `\def` macros. We previously set "verbatim mode"
even for parsing the initial `\def`; this caused problems for things
like
```
\def\foo{\def\bar{BAR}}
\foo
\bar
```
- Implement `\newif`.
- Add tests.
56 lines
454 B
Markdown
56 lines
454 B
Markdown
```
|
|
% pandoc -f latex -t plain
|
|
\iftrue
|
|
should print
|
|
\iftrue
|
|
should print
|
|
\else
|
|
should not print
|
|
\fi
|
|
\else
|
|
should not print
|
|
\fi
|
|
|
|
\iffalse
|
|
should not print
|
|
\else
|
|
\iftrue
|
|
should print
|
|
\else
|
|
should not print
|
|
\fi
|
|
\fi
|
|
|
|
\newif\ifepub
|
|
|
|
\ifepub
|
|
should not print
|
|
\fi
|
|
|
|
\epubtrue
|
|
|
|
\ifepub
|
|
should print
|
|
\else
|
|
should not print
|
|
\fi
|
|
|
|
\epubfalse
|
|
|
|
\ifepub
|
|
should not print
|
|
\else
|
|
should print
|
|
\fi
|
|
^D
|
|
should print
|
|
|
|
should print
|
|
|
|
should print
|
|
|
|
should print
|
|
|
|
should print
|
|
```
|