aboutsummaryrefslogtreecommitdiff
path: root/src/Text
AgeCommit message (Collapse)AuthorFilesLines
2019-11-02LaTeX untokenize: Ensure space between control sequence and following letter.John MacFarlane2-2/+15
Closes #5836.
2019-11-02LaTeX reader: Don't omit macro definitions defined in the preamble.John MacFarlane1-6/+7
These were formerly omitted (though they still affected macro resolution if `latex_macros` was set). Now they are included in the document.
2019-11-02LaTeX reader: parse macro defs as raw latex...John MacFarlane1-8/+13
when `latex_macros` is disabled. (When `latex_macros` is enabled, we omit them, since pandoc is applying the macros itself.) Previously, it was documented that the macro definitions got passed through as raw latex regardless of whether `latex_macros` was set -- but in fact they never got passed through.
2019-11-02LaTeX reader: fixed a hang/memory leak in certain circumstances.John MacFarlane1-3/+3
We were using `grouped blocks` instead of `grouped block`. This caused the reader to hang in an infinite loop (with a memory leak) on e.g. `\parbox{1em}{#1}`. Closes #5845.
2019-11-02Move extension-adding to applyDefaultsJohn MacFarlane1-6/+5
2019-11-01Revert "ALlow multiple comma-separated files for `--defaults`."John MacFarlane1-7/+6
This reverts commit e96f3fd813b3f8b73c3457ff6e9177e2a4a74164.
2019-11-01ALlow multiple comma-separated files for `--defaults`.John MacFarlane1-6/+7
2019-11-01Factor out applyDefaults in T.P.A.CommandLineOptions.John MacFarlane1-20/+24
2019-11-01`--defaults` improvements.John MacFarlane2-89/+114
- ToYAML instance is now for `Opt -> Opt`, rather than `Opt`. - This allows us to handle `--defaults` without clobbering all the options that occur prior to `--defaults` on the command line. (Note, however, that options in `--defaults` can replace these options if the `--defaults` option is used after them, which may be a bit confusing given the name.) - `--defaults` may now be used multiple times on the command line, allowing users to break defaults into different chunks.
2019-10-31Jira writer: remove extraneous newline after single-line block quotesAlbert Krewinkel1-1/+1
See #5858
2019-10-30docbook reader: fix nesting of chapters and sections (#5864)Florian Klink1-1/+1
* Set dbBook to true when traversing a chapter too. Currently, a `<title/>` in a chapter and in a `<section/>` below that chapter have the same level if they're not inside a `<book/>`. This can happen in a multi-file book project. Also see the example at https://tdg.docbook.org/tdg/4.5/chapter.html Co-authored-by: Félix Baylac-Jacqué <felix@alternativebit.fr> * Add docbook-chapter test This tests nested `<section/>` and makes sure `<title/>` in the first `<section/>` below `<chapter/>` is one level deeper than the `<chapter/>`'s `<title/>`, also when not inside a `<book/>`. Co-authored-by: Félix Baylac-Jacqué <felix@alternativebit.fr>
2019-10-29T.P.W.Shared: Changed gridTables so it does better at...John MacFarlane1-16/+20
...keeping the widths of columns. See #4320. Adjust test case for #4320.
2019-10-29Changes to build with new doctemplates/doclayout.John MacFarlane21-84/+114
The new version of doctemplates adds many features to pandoc's templating system, while remaining backwards-compatible. New features include partials and filters. Using template filters, one can lay out data in enumerated lists and tables. Templates are now layout-sensitive: so, for example, if a text with soft line breaks is interpolated near the end of a line, the text will break and wrap naturally. This makes the templating system much more suitable for programatically generating markdown or other plain-text files from metadata.
2019-10-29Shared.makeSections: better behavior in some corner cases.John MacFarlane1-3/+7
When a div surrounds multiple sections at the same level, or a section of highre level followed by one of lower level, then we just leave it as a div and create a new div for the section. Closes #5846, closes #5761.
2019-10-28Shared: improve isTight.John MacFarlane1-1/+1
If a list has an empty item, this should not count against its being a tight list. Closes #5857.
2019-10-27Org reader: fix parsing of empty comment linesAlbert Krewinkel1-1/+3
Comment lines in Org-mode can be completely empty; both of these line should produce no output: # a comment # The reader used to produce a wrong result for the latter, but ignores that line as well now. Fixes: #5856
2019-10-25Beamer writer: fix regression with hrules separating slides.John MacFarlane1-3/+3
2019-10-24HTML reader/writer: Better handling of <q> with cite attribute (#5837)Ole Martin Ruud2-25/+44
* HTML reader: Handle cite attribute for quotes. If a `<q>` tag has a `cite` attribute, we interpret it as a Quoted element with an inner Span. Closes #5798 * Refactor url canonicalization into a helper function * Modify HTML writer to handle quote with cite. [0]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/q
2019-10-23T.P.Readers.LaTeX.Parsing: add `[Tok]` parameter to rawLaTeXParser.John MacFarlane2-10/+16
This allows us to avoid retokenizing multiple times in e.g. rawLaTeXBlock. (Unexported module, so not an API change.)
2019-10-23Add Reader support for HTML <samp> element (#5843)Amogh Rathore1-0/+9
The `<samp>` element is parsed as a Span with class `sample`. Closes #5792.
2019-10-16Add support for reading & writing <mark> elementsFlorian B1-1/+1
Parse <mark> elements from HTML as HTML span like elements, with a single class matching the tag name `mark`. Mark elements are rendered to HTML using the native <mark> element. Fixes https://github.com/jgm/pandoc/issues/5797.
2019-10-15Add support for reading and writing <kbd> elementsDaniele D'Orazio3-26/+54
* Text.Pandoc.Shared: export `htmlSpanLikeElements` [API change] This commit also introduces a mapping of HTML span like elements that are internally represented as a Span with a single class, but that are converted back to the original element by the html writer. As of now, only the kbd element is handled this way. Ideally these elements should be handled as plain AST values, but since that would be a breaking change with a large impact, we revert to this stop-gap solution. Fixes https://github.com/jgm/pandoc/issues/5796.
2019-10-15Muse reader: do not allow closing asterisks to be followed by "*"Alexander Krotov1-2/+7
2019-10-15Muse reader: do not split series of asterisks into symbols and emphasisAlexander Krotov1-0/+7
Fixes #5821
2019-10-15Muse reader: do not terminate emphasis on "*" not followed by spaceAlexander Krotov1-2/+1
2019-10-14change indentation of math part in Writers/HTML.hsmb211-33/+44
2019-10-14KaTeX math: respect classoption=fleqn variablemb211-2/+6
closes #5815
2019-10-14Bump KaTeX version to 0.11.1mb211-1/+1
2019-10-12LaTeX writer: fix horizontal rule.John MacFarlane1-1/+1
We change to use 0.5pt rather than `\linethickness`, which apparently only ever worked "by accident" and no longer works with recent updates to texlive. Closes #5801.
2019-10-11Fix `gfm_auto_identifiers` behavior with emojis.John MacFarlane1-1/+8
Closes #5813. Note that we also now use emoji names for emojis when `ascii_identifiers` is enabled.
2019-10-11Markdown writer: prefer pipe_tables to raw html...John MacFarlane1-3/+3
...even when we must lose width information. All in all this seems to be people's preferred behavior, even though it is slightly lossier. Closes #2608. Closes #4497.
2019-10-11Allow output-file to be null in --defaults.John MacFarlane1-1/+1
2019-10-11Remove redundant import.John MacFarlane1-1/+0
2019-10-10Improve parsing of --defaults.John MacFarlane8-45/+390
- Add FromYAML instances to Opt and to all subsidiary types. - Remove the use of HsYAML-aeson, which doesn't give good position information on errors. - Rename some fields in Opt to better match cli options or reflect what the ycontain [API change]: + optMetadataFile -> optMetadataFiles + optPDFEngineArgs -> optPDFEngineOpts + optWrapText -> optWrap - Add IpynbOutput enumerated type to Text.Pandoc.App.Opts. Use this instead fo a string for optIpynbOutput. - Add FromYAML instance for Filter in Text.Pandoc.Filters. With these changes parsing of defaults files should be complete and should give decent error messages. Now (unlike before) we get an error if an unknown field is used.
2019-10-10Add -d as synonym for --defaults.John MacFarlane1-1/+1
2019-10-10Reorder options in `--help`.John MacFarlane1-58/+58
2019-10-10`--metadata-file`: when multiple files specified, second takes precedence...John MacFarlane2-1/+5
on conflicting fields. This changes earlier behavior (but not in a release), where first took precedence. Note that this may seem inconsistent with the behavior of multiple YAML blocks within a document, where the first takes precedence. Still, it is convenient to be able to override defaults with options later on the command line.
2019-10-10Make some writers sensitive to 'unlisted' class on headings.John MacFarlane2-7/+10
If this is present on a heading with the 'unnumbered' class, the heading won't appear in the TOC. This class has no effect if 'unnumbered' is not also specified. This affects HTML-based writers (including slide shows and epub), LateX (including beamer), RTF, and PowerPoint. Other writers do not yet support `unlisted`. Closes #1762.
2019-10-10Remove unnecessary import.John MacFarlane1-1/+0
2019-10-09--defaults: add .yaml extension if absent, look in user data dir...John MacFarlane1-13/+30
under "defaults" subdirectory.
2019-10-09T.P.App.Opt: rename optReader, optWriter as optFrom, optTo.John MacFarlane4-9/+9
This will allow to: and from: in defaults.
2019-10-09Make sure that input-files works in --default files.John MacFarlane1-1/+1
2019-10-09RST writer: proper handling of :align: on figures, images.John MacFarlane1-6/+12
When the image has the `align-right` (etc.) class, we now use an `:align:` attribute. Closes #4420.
2019-10-09Basic changes for MathJax 3.zorkow2-2/+2
2019-10-09Initial implementation of --defaults option.John MacFarlane2-3/+24
Need documentation.
2019-10-09T.P.App.Opt: Changed optMetadata to Meta, to allow structured values.John MacFarlane4-52/+48
[API change] The current behavior of the `--metadata` option stays the same.
2019-10-09Change optVariables from [(String, String)] to Context Text.John MacFarlane3-26/+36
In Text.Pandoc.App.Opt [API change].
2019-10-09Options.WriterOptions: Change type of writerVariables to Context Text.John MacFarlane10-49/+126
This will allow structured values. [API change]
2019-10-08Use th to derive json instance for LineEnding.John MacFarlane1-16/+4
2019-10-07Text.Pandoc.Options: change To/FromJSON instances for...John MacFarlane2-9/+35
HTMLMathMethod, CiteMethod, ObfuscationMethod, TrackChanges, WrapOption, TopLevelDivision, ReferenceLocation, HTMLSlideVariant. In each case we use lowercase (or hyphenated lowercase) for constructors to line up more closely with command-line option values. This is a breaking change for those who manually decode or encode JSON for these data types (e.g. for ReaderOptions or WriterOptions). See #5790.