aboutsummaryrefslogtreecommitdiff
path: root/src/Text
AgeCommit message (Collapse)AuthorFilesLines
2018-10-18Man reader: improve list parsing.John MacFarlane1-20/+13
We now handle all kinds of ordered list markers. We also avoid having an extra bullet character in bullet list contents.
2018-10-18Man reader: remove final newline in code blocks.John MacFarlane1-1/+5
This is consistent with other readers.
2018-10-18Man reader: use report instead of logMessage.John MacFarlane1-2/+6
2018-10-18Man reader: improved parsing of groff escapes.John MacFarlane1-80/+116
We now handle all the named escapes, plus combining accents and unicode escapes.
2018-10-18GroffChar: fixed interpretation of `\-`.John MacFarlane1-1/+1
It is the ascii - sign, not the unicode hyphen.
2018-10-18Merge branch 'Yanpas-groff_reader'John MacFarlane2-0/+561
2018-10-18Remove unneeded import.John MacFarlane1-1/+0
2018-10-18Groff escaping changes.John MacFarlane4-63/+70
- `--ascii` is now turned on automatically for man output, for portability. All man output will be escaped to ASCII. - In T.P.Writers.Groff, `escapeChar`, `escapeString`, and `escapeCode` now take a boolean parameter that selects ascii-only output. This is used by the Ms writer for `--ascii`, instead of doing an extra pass after writing the document. - In ms output without `--ascii`, unicode is used whenever possible (e.g. for double quotes). - A few escapes are changed: e.g. `\[rs]` instead of `\\` for backslash, and `\ga]` instead of `` \` `` for backtick.
2018-10-18Add Text.Pandoc.GroffChar.John MacFarlane2-20/+420
This will hold common escaping data for groff characters.
2018-10-17man/ms writers: use `\[at]` for escaped `@`.John MacFarlane1-1/+1
2018-10-17Move common groff functions to Text.Pandoc.Writers.GroffJohn MacFarlane4-151/+155
(unexported module). These are used in both the man and ms writers. Moved groffEscape out of Text.Pandoc.Writers.Shared [cancels earlier API change from adding it, which was after last release]. This fixes strong/code combination on man (should be `\f[CB]` not `\f[BC]`), mentioned in #4973. Updated tests. Closes #4975.
2018-10-17Man writer: use \f[R] instead of \f[] to reset fontAlexander Krotov1-2/+2
Fixes #4973
2018-10-17Muse reader: allow examples to be indented with tabsAlexander Krotov1-8/+5
2018-10-17Muse reader: remove indentation from examples indicated by {{{ and }}}Alexander Krotov1-4/+7
2018-10-16Merge branch 'groff_reader' of https://github.com/Yanpas/pandoc into ↵John MacFarlane2-0/+561
Yanpas-groff_reader
2018-10-17added old-style testYan Pas1-0/+1
2018-10-16Muse reader: simplify "atStart"Alexander Krotov1-5/+6
2018-10-16Muse reader: code cleanupAlexander Krotov1-33/+29
2018-10-16Muse reader: simplify "commonPrefix" implementationAlexander Krotov1-5/+1
2018-10-16Muse reader: simplify emphasis parsingAlexander Krotov1-17/+7
2018-10-15LaTeX reader: small verbatim mode cleanups.John MacFarlane1-17/+15
2018-10-15LaTeX reader: withVerbatimMode now does nothing if already inJohn MacFarlane1-4/+8
verbatim mode. Previously nested uses wouldn't work properly.
2018-10-15LaTeX reader: simplified type on doMacros'.John MacFarlane2-12/+9
2018-10-16buildersYan Pas1-64/+58
2018-10-15LaTeX reader: small efficiency improvement.John MacFarlane1-1/+2
2018-10-15LaTeX reader: tokenize before pulling tokens,John MacFarlane2-15/+16
rather than after. This has some performance penalty but is more reliable. Closes #4408.
2018-10-16font as a set of styles, mono font supportYan Pas1-24/+39
2018-10-15style issuesYan Pas1-12/+9
2018-10-15LaTeX reader: more care with verbatim mode in macro definitions.John MacFarlane1-17/+20
This solves some of the issues in #4408, but it is fragile and may introduce new problems. We really need to change the approach fundamentally and expand macros before pulling tokens from the stream, rather than after.
2018-10-15LaTeX reader: more careful placement of withVerbatimMode.John MacFarlane1-14/+16
for macros
2018-10-15LaTeX reader: make macroDef polymorphic and allow in inline context.John MacFarlane1-10/+4
Otherwise we can't parse something like ``` \lowercase{\def\x{Foo}} ``` I have actually seen tex like this in the wild.
2018-10-15LaTeX reader: improved parsing of `\def`, `\let`.John MacFarlane2-27/+41
We now correctly parse: ``` \def\bar{hello} \let\fooi\bar \def\fooii{\bar} \fooi +\fooii \def\bar{goodbye} \fooi +\fooii ```
2018-10-15LaTeX reader: Fix small regression in pattern argumnents...John MacFarlane1-1/+2
introduced in last commit.
2018-10-15More refactoring of LaTeX reader code.John MacFarlane2-34/+37
2018-10-15T.P.R.LaTeX.Parsing: moved more functions.John MacFarlane1-57/+64
2018-10-15LaTeX reader: improve parsing of `\def` argspec.John MacFarlane1-4/+4
2018-10-15T.P.R.LaTeX.Parsing: moved some functions up a level.John MacFarlane1-20/+21
2018-10-15Lua filters: rename ReaderOptions fields, use snake_caseAlbert Krewinkel1-5/+28
Snake case is used in most variable names, using camelCase for these fields was an oversight. A metatable is added to ensure that the old field names remain functional.
2018-10-14LaTeX reader: skip `\PackageError` commands.John MacFarlane1-0/+2
See #4408. But this doesn't fix the issue.
2018-10-14Markdown writer: ensure blank between raw block and normal content.John MacFarlane1-0/+7
Otherwise a raw block can prevent a paragraph from being recognized as such. Closes #4629.
2018-10-14Markdown reader: Fix awkward soft break movements before abbreviations.John MacFarlane1-5/+10
Closes #4635.
2018-10-14Custom writer: provide PANDOC_DOCUMENT instead of Setup functionAlbert Krewinkel1-18/+26
Custom writers have access to the global variable `PANDOC_DOCUMENT`. The variable contains a userdata wrapper around the full pandoc AST and exposes two fields, `meta` and `blocks`. The field content is only marshaled on-demand, performance of scripts not accessing the fields remains unaffected.
2018-10-14Markdown reader: Added updateStrPos in a couple places where needed.John MacFarlane1-1/+2
2018-10-13Custom writer: give full access to doc in optional Setup function (#4967)Albert Krewinkel1-1/+16
Custom writers can specify an optional `Setup` function. The function takes the full Pandoc document as input and should not return any value. Users can use this function to configure the writer depending on the given document's content or its metadata. data/sample.lua: add sample use of Setup function. The change allows to control the image format used to encode the image produced from dot code. Closes #4957
2018-10-14tests, commented debug functionsYan Pas1-11/+12
2018-10-13Lua filter internals: push Shared.Element as userdataAlbert Krewinkel1-19/+24
Hierarchical Elements were pushed to Lua as plain tables. This is simple, but has the disadvantage that marshaling is eager: all child elements will be marshaled as part of the object. Using a Lua userdata object instead allows lazy access to fields, causing content marshaling just (but also each time) when a field is accessed. Filters which do not traverse the full element contents tree become faster as a result.
2018-10-12Lua filters: push ListAttributes via constructorAlbert Krewinkel2-2/+17
This ensures that ListAttributes, as present in OrderedList elements, have additional accessors (viz. *start*, *style*, and *delimiter*).
2018-10-11HTML reader: fix htmlTag and isInlineTag to accept processing instructions.John MacFarlane1-8/+10
Fixes regression #3123 (since 2.0). Added regression test.
2018-10-11Muse reader internals: don't use "choice" with static listAlexander Krotov1-18/+16
2018-10-11Muse reader: use indentWith to parse indentationAlexander Krotov1-2/+2