Age | Commit message (Collapse) | Author | Files | Lines |
|
This rewrite is primarily motivated by the need to
get macros working properly. A side benefit is that the
reader is significantly faster (27s -> 19s in one
benchmark, and there is a lot of room for further
optimization).
We now tokenize the input text, then parse the token stream.
Macros modify the token stream, so they should now be effective
in any context, including math. Thus, we no longer need the clunky
macro processing capacities of texmath.
A custom state LaTeXState is used instead of ParserState.
This, plus the tokenization, will require some rewriting
of the exported functions rawLaTeXInline, inlineCommand,
rawLaTeXBlock.
* Added Text.Pandoc.Readers.LaTeX.Types (new exported module).
Exports Macro, Tok, TokType, Line, Column. [API change]
* Text.Pandoc.Parsing: adjusted type of `insertIncludedFile`
so it can be used with token parser.
* Removed old texmath macro stuff from Parsing.
Use Macro from Text.Pandoc.Readers.LaTeX.Types instead.
* Removed texmath macro material from Markdown reader.
* Changed types for Text.Pandoc.Readers.LaTeX's
rawLaTeXInline and rawLaTeXBlock. (Both now return a String,
and they are polymorphic in state.)
* Added orgMacros field to OrgState. [API change]
* Removed readerApplyMacros from ReaderOptions.
Now we just check the `latex_macros` reader extension.
* Allow `\newcommand\foo{blah}` without braces.
Fixes #1390.
Fixes #2118.
Fixes #3236.
Fixes #3779.
Fixes #934.
Fixes #982.
|
|
The readers previously assumed that CRs had been filtered
from the input. Now we strip the CRs in the readers themselves,
before parsing. (The point of this is just to simplify the
parsers.)
Shared now exports a new function `crFilter`. [API change]
And `tabFilter` no longer filters CRs.
|
|
Formerly tracing was just log messages with a DEBUG log
level. We now make these things independent. Tracing
can be turned on or off in PandocMonad using `setTrace`;
it is independent of logging.
* Removed `DEBUG` from `Verbosity`.
* Removed `ParserTrace` from `LogMessage`.
* Added `trace`, `setTrace` to `PandocMonad`.
|
|
Readers: Renamed StringReader -> TextReader.
Updated tests.
API change.
|
|
By not checking for the end condition before the first parse, the
parser was applied too often, consuming too much of the input.
This fixes the behaviour of
`testStringWith (many1Till (oneOf "ab") (string "aa")) "aaa"`
which before incorrectly returned `Right "a"`. With this change, it
instead correctly fails with `Left (PandocParsecError ...)` because it
is not able to parse at least one occurence of `oneOf "ab"` that is
not `"aa"`.
Note that this only affects `many1Till p end` where `p` matches on a
prefix of `end`.
|
|
This is a verison of parseFromString specialied to
ParserState, which resets stateLastStrPos at the end.
This is almost always what we want.
This fixes a bug where `_hi_` wasn't treated as emphasis in
the following, because pandoc got confused about the
position of the last word:
- [o] _hi_
Closes #3690.
|
|
Closes #3667.
|
|
This follows the suggestions given by the FSF for GPL licensed software.
<https://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html>
|
|
|
|
|
|
This now contains the Verbosity definition previously
in Options, as well as a new LogMessage datatype that
will eventually be used instead of raw strings for
warnings.
This will enable us, among other things, to provide
machine-readable warnings if desired.
See #3392.
|
|
These were confusing.
Now we rely on the +raw_tex or +raw_html extension with latex
or html input.
Thus, instead of
--parse-raw -f latex
we use
-f latex+raw_tex
and instead of
--parse-raw -f html
we use
-f html+raw_html
|
|
Class:
* Removed getWarnings, withWarningsToStderr
* Added report
* Added logOutput to PandocMonad
* Make logOutput streaming in PandocIO monad
* Properly reverse getLog output
Readers:
* Replaced use of trace with report DEBUG.
TWiki Reader: Put everything inside PandocMonad m.
API changes.
|
|
API changes: Text.Pandoc.Options:
* Added Verbosity.
* Added writerVerbosity.
* Added readerVerbosity.
* Removed writerVerbose.
* Removed readerTrace.
pandoc CLI: The `--trace` option sets verbosity to DEBUG;
the `--quiet` option sets it to ERROR, and the `--verbose`
option sets it to INFO. The default is WARNING.
|
|
API change. CLI option change.
|
|
Since we've unified error types, we can just throw the same error at
the toplevel.
|
|
|
|
|
|
This was only necessary for GHC versions with base below 4.5
(i.e., ghc < 7.4).
|
|
They are meant to be interpreted as literal text in textile.
Closes #3042.
|
|
Closes #3036.
|
|
Also, remove trailing newline in code blocks (consistently
with Markdown reader).
|
|
- Allow multiple terms (which we concatenate with linebreaks).
- Fix exponential parsing bug (closes #3020 for real this time).
|
|
We now handle cell and row attributes, mostly by skipping
them. However, alignments are now handled properly.
Since in pandoc alignment is per-column, not per-cell, we
try to devine column alignments from cell alignments.
Table captions are also now parsed, and textile indicators
for thead and tfoot no longer cause parse failure. (However,
a row designated as tfoot will just be a regular row in pandoc.)
|
|
Closes #3020.
|
|
Spaces are not allowed in the image URL in textile.
Closes #2998.
|
|
Attributes can't be followed by a space.
So,
_(class)emph_
but
_(noclass) emph_
Closes #2984.
|
|
Closes #2674.
|
|
The reader previously did allow this, following redcloth,
which happily parses
Html blocks can be <div>inlined</div> as well.
as
<p>Html blocks can be <div>inlined</div> as well.</p>
This is invalid HTML, and this kind of thing can lead
to parsing problems (stack overflows) as well. So this
commit undoes this behavior. The above sample now produces;
<p>Html blocks can be</p>
<div>
<p>inlined</p>
</div>
<p>as well.</p>
|
|
and use it in Textile reader
|
|
closes #2515
|
|
We don't have a place yet for styles or sizes on images, but
we can skip the attributes rather than incorrectly taking them
to be part of the filename.
Closes #2515.
|
|
Don't use custom prelude for latest ghc.
This is a better approach to making 'stack ghci' and 'cabal repl'
work. Instead of using NoImplicitPrelude, we only use the custom
prelude for older ghc versions. The custom prelude presents a
uniform API that matches the current base version's prelude.
So, when developing (presumably with latest ghc), we don't
use a custom prelude at all and hence have no trouble with ghci.
The custom prelude no longer exports (<>): we now want to
match the base 4.8 prelude behavior.
|
|
This reverts commit c423dbb5a34c2d1195020e0f0ca3aae883d0749b.
|
|
This is needed for ghci to work with pandoc, given that we
now use a custom prelude.
Closes #2503.
|
|
Closes #2480.
Note that although smart punctuation is part of the textile
spec, it's not always wanted when converting from textile
to, say, Markdown. So it seems better to make this an option.
|
|
- The (non-exported) prelude is in prelude/Prelude.hs.
- It exports Monoid and Applicative, like base 4.8 prelude,
but works with older base versions.
- It exports (<>) for mappend.
- It hides 'catch' on older base versions.
This allows us to remove many imports of Data.Monoid
and Control.Applicative, and remove Text.Pandoc.Compat.Monoid.
It should allow us to use -Wall again for ghc 7.10.
|
|
|
|
|
|
|
|
* Handle newlines in cells.
* Handle empty cells.
* Closes #1919.
|
|
Closes #1513.
Lists can now start without an intervening blank line.
Also, html block-level tags that don't start a line are parsed
as RawInline and don't interrupt paragraphs, as in RedCloth.
|
|
|
|
This matches behavior of RedCarpet, avoids some ugly bugs, and improves
performance.
|
|
|
|
|
|
Textile reader hung on
pandoc -f textile http://johnmacfarlane.net/pandoc/demo/example25.textile
The reader no longer hangs.
|
|
This is possible because of the rewrite of simpleInline.
Also removed a redundant parser for grouped inlines.
|
|
This way we only look once for the opening `[`.
|
|
@hi
there@
should not be a single code span.
|