diff options
-rw-r--r-- | changelog | 567 | ||||
-rw-r--r-- | src/Text/Pandoc/Readers/DocBook.hs | 20 | ||||
-rw-r--r-- | src/Text/Pandoc/Readers/Docx.hs | 2 | ||||
-rw-r--r-- | src/Text/Pandoc/Readers/Docx/Reducible.hs | 10 | ||||
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 67 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/ConTeXt.hs | 2 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/HTML.hs | 13 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/LaTeX.hs | 7 | ||||
-rw-r--r-- | tests/docbook-reader.docbook | 48 | ||||
-rw-r--r-- | tests/docbook-reader.native | 2 | ||||
-rw-r--r-- | tests/markdown-reader-more.native | 9 | ||||
-rw-r--r-- | tests/markdown-reader-more.txt | 16 | ||||
-rw-r--r-- | tests/writer.html | 10 |
13 files changed, 485 insertions, 288 deletions
@@ -1,21 +1,179 @@ pandoc (1.13) - * Added Docx reader (API change) (Jesse Rosenthal). Includes conversion - of Word equations to latex in pandoc `Math` elements. Note that metadata - is taken from paragraphs at the beginning styled with `Author`, - `Title`, `Subtitle`, `Date`, and `Abstract`. + [new features] + + * Added `docx` as an input format (Jesse Rosenthal). The docx + reader includes conversion of native Word equations to pandoc + LaTeX `Math` elements. Metadata is taken from paragraphs at the + beginning of the document with styles `Author`, `Title`, `Subtitle`, + `Date`, and `Abstract`. + + * Added `epub` as an input format (Matthew Pickering). The epub + reader includes conversion of MathML to pandoc LaTeX `Math` + elements. + + * Added `t2t` (Txt2Tags) as an input format (Matthew Pickering). + Txt2tags is a lightweight markup format described at + <http://txt2tags.org/>. - * Added EPUB reader (API change) (Matthew Pickering). Includes conversion - of MathML math to latex in pandoc `Math` elements. + * Added `dokuwiki` as an output format (Clare Macrae). - * Added txt2tags reader (Matthew Pickering). Txt2tags is a lightweight - markup format described at <http://txt2tags.org/>. + * Added `haddock` as an output format. * Added `--extract-media` option to extract media contained in a zip container (docx or epub) while adjusting image paths to point to the extracted images. - * Added module `Text.Pandoc.MediaBag`, exporting `MediaBag`, `lookupMedia`, + * Added a new markdown extension, `compact_definition_lists`, that + restores the syntax for definition lists of pandoc 1.12.x, allowing + tight definition lists with no blank space between items, and + disallowing lazy wrapping. (See below under behavior changes.) + + * Added an extension `epub_html_exts` for parsing HTML in EPUBs. + + * Added extensions `native_spans` and `native_divs` to activate + parsing of material in HTML span or div tags as Pandoc Span + inlines or Div blocks. + + * `--trace` now works with the Markdown, HTML, Haddock, EPUB, + Textile, and MediaWiki readers. This is an option intended + for debugging parsing problems; ordinary users should not need + to use it. + + [behavior changes] + + * Changed behavior of the `markdown_attribute` extension, to bring + it in line with PHP markdown extra and multimarkdown. Setting + `markdown="1"` on an outer tag affects all contained tags, + recursively, until it is reversed with `markdown="0"` (#1378). + + * Revised markdown definition list syntax (#1429). Both the reader + and writer are affected. This change brings pandoc's definition list + syntax into alignment with that used in PHP markdown extra and + multimarkdown (with the exception that pandoc is more flexible about + the definition markers, allowing tildes as well as colons). Lazily + wrapped definitions are now allowed. Blank space is required + between list items. The space before a definition is used to determine + whether it is a paragraph or a "plain" element. **WARNING: This change + may break existing documents!** Either check your documents for + definition lists without blank space between items, or use + `markdown+compact_definition_lists` for the old behavior. + + * `.numberLines` now works in fenced code blocks even if no language + is given (#1287, jgm/highlighting-kate#40). + + * Improvements to `--filter`: + + + Don't search PATH for a filter with an explicit path. + This fixed a bug wherein `--filter ./caps.py` would run `caps.py` from + the system path, even if there was a `caps.py` in the working directory. + + Respect shebang if filter is executable (#1389). + + Don't print misleading error message. + Previously pandoc would say that a filter was not found, + even in a case where the filter had a syntax error. + + * HTML reader: + + + Parse `div` and `span` elements even without `--parse-raw`, + provided `native_divs` and `native_spans` extensions are set. + Motivation: these now generate native pandoc Div and Span + elements, not raw HTML. + + Parse EPUB-specific elements if the `epub_html_exts` + extension is enabled. These include `switch`, `footnote`, + `rearnote`, `noteref`. + + * Org reader: + + + Support for inline LaTeX. Inline LaTeX is now accepted and parsed by the + org-mode reader. Both math symbols (like `\tau`) and LaTeX commands (like + `\cite{Coffee}`), can be used without any further escaping (Albert + Krewinkel). + + * DocBook reader: + + + Support `equation`, `informalequation`, `inlineequation` elements with + `mml:math` content. This is converted into LaTeX and put into a Pandoc + Math inline. + + * Revised `plain` output, largely following the style of Project + Gutenberg: + + + Emphasis is rendered with `_underscores_`, strong emphasis + with ALL CAPS. + + Headings are rendered differently, with space to set them off, + not with setext style underlines. Level 1 headers are ALL CAPS. + + Math is rendered using unicode when possible, but without the + distracting emphasis markers around variables. + + Footnotes use a regular `[n]` style. + + * Markdown writer: + + + Horizontal rules are now a line across the whole page. + + Prettier pipe tables. Columns are now aligned (#1323). + + Respect the `raw_html` extension. `pandoc -t markdown-raw_html` + no longer emits any raw HTML, including span and div tags + generated by Span and Div elements. + + Use span with style for `SmallCaps` (#1360). + + * HTML writer: + + + Autolinks now have class `uri`, and email autolinks have class + `email`, so they can be styled. + + * Docx writer: + + + Document formatting is carried over from `reference.docx`. + This includes margins, page size, page orientation, header, + and footer, including images in headers and footers. + + Include abstract (if present) with `Abstract` style (#1451). + + Include subtitle (if present) with `Subtitle` style, rather + than tacking it on to the title (#1451). + + * Org writer: + + + Write empty span elements with an id attribute as org anchors. + For example `Span ("uid",[],[]) []` becomes `<<uid>>`. + + * LaTeX writer: + + + Put table captions above tables, to match the conventional + standard. (Previously they appeared below tables.) + + Use `\(..\)` instead of `$..$` for inline math (#1464). + + Use `\nolinkurl` in email autolinks. This allows them to be styled + using `\urlstyle{tt}`. Thanks to Ulrike Fischer for the solution. + + Use `\textquotesingle` for `'` in inline code. Otherwise we get + curly quotes in the PDF output (#1364). + + Use `\footnote<.>{..}` for notes in beamer, so that footnotes + do not appear before the overlays in which their markers appear + (#1525). + + Don't produce a `\label{..}` for a Div or Span element. Do produce + a `\hyperdef{..}` (#1519). + + * Custom lua writers: + + + Custom writers now work with `--template`. + + Removed HTML header scaffolding from `sample.lua`. + + Made citation information available in lua writers. + + * `--normalize` and `Text.Pandoc.Shared.normalize` now consolidate + adjacent `RawBlock`s when possible. + + [API changes] + + * Added `Text.Pandoc.Readers.Docx`, exporting `readDocx` (Jesse Rosnthal). + + * Added `Text.Pandoc.Readers.EPUB`, exporting `readEPUB` (Matthew + Pickering). + + * Added `Text.Pandoc.Readers.Txt2Tags`, exporting `readTxt2Tags` (Matthew + Pickering). + + * Added `Text.Pandoc.Writers.DokuWiki`, exporting `writeDokuWiki` + (Clare Macrae). + + * Added `Text.Pandoc.Writers.Haddock`, exporting `writeHaddock`. + + * Added `Text.Pandoc.MediaBag`, exporting `MediaBag`, `lookupMedia`, `insertMedia`, `mediaDirectory`, `extractMediaBag`. The docx and epub readers return a pair of a `Pandoc` document and a `MediaBag` with the media resources they contain. This can be extracted using @@ -24,12 +182,82 @@ pandoc (1.13) for resources in the `MediaBag` generated by the reader, in addition to the file system or web. + * `Text.Pandoc.Readers.TexMath`: Removed deprecated `readTeXMath`. + Renamed `readTeXMath'` to `texMathToInlines`. + + * `Text.Pandoc`: Added `Reader` data type (Matthew Pickering). + `readers` now associates names of readers with `Reader` + structures. This allows inclusion of readers, like the docx + reader, that take binary rather than textual input. + + * `Text.Pandoc.Shared`: + + + Added `capitalize` (Artyom Kazak), and replaced uses of + `map toUpper` (which give bad results for many languages). + + Added `collapseFilePath`, which removes intermediate `.` and + `..` from a path (Matthew Pickering). + + Added `fetchItem'`, which works like `fetchItem` but searches + a `MediaBag` before looking on the net or file system. + + Added `withTempDir`. + + Added `removeFormatting`. + + Added `extractSpaces` (from HTML reader) and generalized its type + so that it can be used by the docx reader (Matthew Pickering). + + Added `ordNub`. + + Added `normalizeInlines`, `normalizeBlocks`. + + `normalize` is now `Pandoc -> Pandoc` instead of + `Data a :: a -> a`. Some users may need to change their uses of + `normalize` to the newly exported `normalizeInlines` or + `normalizeBlocks`. + + * `Text.Pandoc.Options`: + + + Added `writerMediaBag` to `WriterOptions`. + + Removed deprecated and no longer used `readerStrict` in + `ReaderOptions`. This is handled by `readerExtensions` now. + + Added `Ext_compact_definition_lists`. + + Added `Ext_epub_html_exts`. + + Added `Ext_native_divs` and `Ext_native_spans`. + This allows users to turn off the default pandoc behavior of + parsing contents of div and span tags in markdown and HTML + as native pandoc Div blocks and Span inlines. + + * `Text.Pandoc.Parsing`: + + + Generalized `readWith` to `readWithM` (Matthew Pickering). + + Export `runParserT` and `Stream` (Matthew Pickering). + + Added `HasQuoteContext` type class (Matthew Pickering). + + Generalized types of `mathInline`, `smartPunctuation`, `quoted`, + `singleQuoted`, `doubleQuoted`, `failIfInQuoteContext`, + `applyMacros` (Matthew Pickering). + + Added custom `token` (Matthew Pickering). + + Added `stateInHtmlBlock` to `ParserState`. This is used to keep + track of the ending tag we're waiting for when we're parsing inside + HTML block tags. + + Added `stateMarkdownAttribute` to `ParserState`. This is used + to keep track of whether the markdown attribute has been set in + an enclosing tag. + + Generalized type of `registerHeader`, using new type classes + `HasReaderOptions`, `HasIdentifierList`, `HasHeaderMap` (Matthew + Pickering). These allow certain common functions to be reused + even in parsers that use custom state (instead of `ParserState`), + such as the MediaWiki reader. + + Moved `inlineMath`, `displayMath` from Markdown reader to Parsing, + and generalized their types (Matthew Pickering). + + * `Text.Pandoc.Pretty`: + + + Added `nestle`. + + Added `blanklines`, which guarantees a certain number of blank lines + (and no more). + + [bug fixes] + * Markdown reader: - + Changed behavior of the `markdown_attribute` extension, to bring - it in line with PHP markdown extra and multimarkdown. Setting - `markdown="1"` on an outer tag affects all contained tags, - recursively, until it is reversed with `markdown="0"` (#1378). + + Fixed parsing of indented code in list items. Indented code + at the beginning of a list item must be indented eight spaces + from the margin (or edge of the container), or four spaces + from the list marker, whichever is greater. + Fixed small bug in HTML parsing with `markdown_attribute`, which caused incorrect tag nesting for input like `<aside markdown="1">*hi*</aside>`. @@ -54,24 +282,6 @@ pandoc (1.13) github-style fenced blocks (#1318). + Inline math must have nonspace before final `$` (#1313). - * Revised markdown definition list syntax (#1429). - - + This change brings pandoc's definition list syntax into alignment - with that used in PHP markdown extra and multimarkdown (with the - exception that pandoc is more flexible about the definition markers, - allowing tildes as well as colons). - + Lazily wrapped definitions are now allowed. - + Blank space is required between list items. - + The space before a definition is used to determine whether it is - a paragraph or a "plain" element. - + For backwards compatibility, a new extension, - `compact_definition_lists`, has been added that restores the behavior - of pandoc 1.12.x, allowing tight definition lists with no blank space - between items, and disallowing lazy wrapping. - + WARNING: THIS CHANGE MAY BREAK EXISTING DOCUMENTS! Either check your - documents for definition lists without blank space between items, - or use `markdown+compact_definition_lists` for the old behavior. - * LaTeX reader: + Handle comments at the end of tables. This resolves the issue @@ -85,41 +295,26 @@ pandoc (1.13) + Don't assume preamble doesn't contain environments (#1338). + Allow (and discard) optional argument for `\caption` (James Aspnes). - * HTML reader: adjust `blockTags` and `eitherBlockOrInline`. + * HTML reader: - + Parse `div` and `span` elements even without `--parse-raw`. - Motivation: these now generate native pandoc Div and Span - elements, not raw HTML. - + Parse EPUB-specific elements if the `epub_html_exts` - extension is enabled. These include `switch`, `footnote`, - `rearnote`, `noteref`. - + Added `audio` and `source` in `eitherBlockOrInline`. - + Moved `video`, `svg`, `progress`, `script`, `noscript`, `svg` from - `blockTags` to `eitherBlockOrInline`. - + `map` and `object` were mistakenly in both lists; they have been removed - from `blockTags`. + Fixed major parsing problem with HTML tables. Table cells were being combined into one cell (#1341). + Fixed performance issue with malformed HTML tables. We let a `</table>` tag close an open `<tr>` or `<td>` (#1167). - + Support `--trace`. + Allow space between `<col>` and `</col>`. + + Added `audio` and `source` in `eitherBlockOrInline`. + + Moved `video`, `svg`, `progress`, `script`, `noscript`, `svg` from + `blockTags` to `eitherBlockOrInline`. + + `map` and `object` were mistakenly in both lists; they have been removed + from `blockTags`. + Ignore `DOCTYPE` and `xml` declarations. - * Rewrote Haddock reader to use `haddock-library` (#1346). - - + This brings pandoc's rendering of haddock markup in line - with the new haddock. - + Fixed line breaks in `@` code blocks. - + alex and happy are no longer build-depends. - * MediaWiki reader: + Don't parse backslash escapes inside `<source>` (#1445). + Tightened up template parsing. The opening `{{` must be followed by an alphanumeric or `:`. This prevents the exponential slowdown in #1033. - + Support `--trace`. + Support "Bild" for images. * DocBook reader: @@ -128,38 +323,21 @@ pandoc (1.13) model does not allow structure inside code blocks, but at least this way we preserve the text (#1449). + Support `<?asciidoc-br?>` (#1236). - Note, this is a bit of a kludge, to work around the fact that xml-light - doesn't parse `<?asciidoc-br?>` correctly. We preprocess the input, - replacing that instruction with `<br/>`, and then parse that as a line - break. Other XML instructions are simply removed from the input stream. - Eventually we should move to a better xml parser, or get this one fixed. + + * Textile reader: + + + Fixed list parsing. Lists can now start without an intervening + blank line (#1513). + + HTML block-level tags that do not start a line are parsed as + inline HTML and do not interrupt paragraphs (as in RedCloth). * Org reader: + Make tildes create inline code (#1345). Also relabeled `code` and `verbatim` parsers to accord with the org-mode manual. - + Support for inline LaTeX. Inline LaTeX is now accepted and parsed by the - org-mode reader. Both math symbols (like `\tau`) and LaTeX commands (like - `\cite{Coffee}`), can be used without any further escaping (Albert - Krewinkel). + Respect `:exports` header argument in code blocks (Craig Bosma). + Fixed tight lists with sublists (#1437). - * `Text.Pandoc.Readers.TexMath`: Removed deperated `readTeXMath`. - Renamed `readTeXMath'` to `texMathToInlines`. (API change.) - - * `Text.Pandoc`: - - + Added `Reader` data type (API change) (Matthew Pickering). - + `readers` now associates names of readers with `Reader` - structures. This allows inclusion of readers, like the docx - reader, that take binary rather than textual input (Matthew - Pickering). - - * Added DokuWiki markup writer (API change) (Clare Macrae). - - * Added Haddock writer. (API change.) - * EPUB writer: + Avoid excess whitespace in `nav.xhtml`. This should improve @@ -181,17 +359,14 @@ pandoc (1.13) * LaTeX writer: - + Use `\(..\)` instead of `$..$` for inline math (#1464). - + Use `\nolinkurl` in email autolinks. This allows them to be styled - using `\urlstyle{tt}`. Thanks to Ulrike Fischer for the solution. - + Use `\textquotesingle` for `'` in inline code. Otherwise we get - curly quotes in the PDF output (#1364). + Correctly handle figures in notes. Notes can't contain figures in LaTeX, so we fake it to avoid an error (#1053). + Fixed strikeout + highlighted code (#1294). Previously strikeout highlighted code caused an error. - + Put table captions above tables, to match the conventional - standard. (Previously they appeared below tables.) + + * ConTeXt writer: + + + Improved detection of autolinks with URLs containing escapes. * RTF writer: @@ -202,6 +377,9 @@ pandoc (1.13) * HTML writer: + Deactivate "incremental" inside slide speaker notes (#1394). + + Don't include empty items in the table of contents for + slide shows. (These would result from creating a slide + using a horizontal rule.) * MediaWiki writer: @@ -214,74 +392,33 @@ pandoc (1.13) * Markdown writer: - + Updated definition lists, so they match the current markdown reader's - behavior. (Thus, they match PHP markdown extra, and a blank line is - always used between items.) The old behavior - can be activated with the `compact_definition_lists` extension. - + Horizontal rules are now a line across the whole page. + Avoid wrapping that might start a list, blockquote, or header (#1013). - + Use span with style for `SmallCaps` (#1360). + Use Span instead of (hackish) `SmallCaps` in `plainify`. + Don't use braced attributes for fenced code (#1416). If `Ext_fenced_code_attributes` is not set, the first class attribute will be printed after the opening fence as a bare word. - + Prettier pipe tables. Columns are now aligned (#1323). - + Respect the `raw_html` extension. `pandoc -t markdown-raw_html` - no longer emits any raw HTML, including span and div tags - generated by Span and Div elements. + Separate adjacent lists of the same kind with an HTML comment (#1458). - * Plain writer: Revised output, largely following the style of Project - Gutenberg. - - + Emphasis is rendered with `_underscores_`, strong emphasis - with ALL CAPS. - + Headings are rendered differently, with space to set them off, - not with setext style underlines. Level 1 headers are ALL CAPS. - + Math is rendered using unicode when possible, but without the - distracting emphasis markers around variables. - + Footnotes use a regular `[n]` style. - + Added tests. - * PDF writer: - + Moved `withTempDir` to `Text.Pandoc.Shared`, which now exports it. + Fixed treatment of data uris for images (#1062). * Docx writer: - + Header and footer are now carried over from `reference.docx`. - + Take over document formatting from `reference.docx`. - This includes margins, page size, page orientation. + Use Compact style for empty table cells (#1353). Otherwise we get overly tall lines when there are empty table cells and the other cells are compact. - + Create overrides per-image for `media/` in ref docx. + + Create overrides per-image for `media/` in reference docx. This should be somewhat more robust and cover more types of images. - + Improved `entryFromArchive` to avoid parse. No need to parse the XML - if we're just going to render it right away! - + Make images work in `reference.docx` headers/footers. - All media from reference.docx are copied into result. - Added defaults for common image types to `[Content Types]`. - Avoid redundant XML parse + write for entries taken over from - `reference.docx`, for better performance. + + Improved `entryFromArchive` to avoid an unneeded parse. + Section numbering carries over from reference.docx (#1305). + Simplified `abstractNumId` numbering. Instead of sequential numbering, we assign numbers based on the list marker styles. - + Include abstract (if present) with `Abstract` style (#1451). - + Include subtitle (if present) with `Subtitle` style, rather - than tacking it on to the title (#1451). - - * Org writer: - + Write empty span elements with an id attribute as org anchors. - For example `Span ("uid",[],[]) []` becomes `<<uid>>`. - - * Custom lua writers: + * `Text.Pandoc.Options`: - + Custom writers now work with `--template`. - + Removed HTML header scaffolding from `sample.lua`. - + Made citation information availabel in lua writers. + + Removed `Ext_fenced_code_attributes` from `markdown_github` + extensions. * `Text.Pandoc.ImageSize`: @@ -291,137 +428,68 @@ pandoc (1.13) Some images seem to have tag type of 256, which was causing a runtime error. - * `Text.Pandoc.Highlighting`: Let `.numberLines` work even if no language - is given (#1287, jgm/highlighting-kate#40). - - * `Text.Pandoc.Pretty`: Added `blanklines`, which guarantees a certain - number of blank lines (and no more). - * `Text.Pandoc.Shared`: - + Added `collapseFilePath`, which removes intermediate `.` and - `..` from a path (Matthew Pickering). - + Added `fetchItem'`, which works like `fetchItem` but searches - a `MediaBag` before looking on the net or file system. - + Added `withTempDir` (API change). + `fetchItem`: unescape URI encoding before reading local file (#1427). + `fetchItem`: strip a fragment like `?#iefix` from the extension before doing mime lookup, to improve mime type guessing. - + Improved log of `fetchItem`: absolute URIs are fetched from the net; + + Improved logic of `fetchItem`: absolute URIs are fetched from the net; other things are treated as relative URIs if `sourceURL` is `Just _`, otherwise as file paths on the local file system. + `fetchItem` now properly handles links without a protocol (#1477). + `fetchItem` now escapes characters not allowed in URIs before trying to parse the URIs. - + Added `removeFormatting` (API change). - + Added `extractSpaces` (from HTML reader) and generalized its type - so that it can be used by the docx reader (Matthew Pickering). - + Added `ordNub` (API change). + Fixed runtime error with `compactify'DL` on certain lists (#1452). - + Added `capitalize` (Artyom Kazak), and replaced uses of - `map toUpper` (which give bad results for many languages). - - * `Text.Pandoc.Templates`: - - + Fail informatively on template syntax errors. - With the move from parsec to attoparsec, we lost good error - reporting. In fact, since we weren't testing for end of input, - malformed templates would fail silently. Here we revert back to - Parsec for better error messages. - + Added `ordNub` (API change) (#1022). - - * `Text.Pandoc.Options`: - + Added `writerMediaBag` to `WriterOptions` (API change). - + Removed deprecated and no longer used `readerStrict` in - `ReaderOptions`. This is handled by `readerExtensions` now - (API change). - + Removed `Ext_fenced_code_attributes` from `markdown_github` - extensions (API change)`. - + Added `Ext_compact_definition_lists` (API change). - + Added `Ext_epub_html_exts` (API change). - + Added `Ext_native_divs` and `Ext_native_spans` (API change). - This allows users to turn off the default pandoc behavior of - parsing contents of div and span tags in markdown and HTML - as native pandoc Div blocks and Span inlines. + * `pandoc.hs`: Don't strip path off of `writerSourceURL`: the path is + needed to resolve relative URLs when we fetch resources (#750). * `Text.Pandoc.Parsing` - + Generalized `readWith` to `readWithM` (Matthew Pickering) (API change). - + Export `runParserT` and `Stream` (Matthew Pickering). - + Added `HasQuoteContext` type class (Matthew Pickering). - + Generalized types of `mathInline`, `smartPunctuation`, `quoted`, - `singleQuoted`, `doubleQuoted`, `failIfInQuoteContext`, - `applyMacros` (Matthew Pickering). - + Added custom `token` (Matthew Pickering). + Simplified `dash` and `ellipsis` (#1419). + Removed `(>>~)` in favor of the equivalent `(<*)` (Matthew Pickering). + Generalized functions to use `ParsecT` (Matthew Pickering). - + Added `stateInHtmlBlock` to `ParserState`. This is used to keep - track of the ending tag we're waiting for when we're parsing inside - HTML block tags. (API change.) - + Added `stateMarkdownAttribute` to `ParserState`. This is used - to keep track of whether the markdown attribute has been set in - an enclosing tag. (API change.) + Added `isbn` and `pmid` to list of recognized schemes (Matthew Pickering). - * Added `Text.Pandoc.Compat.Directory` to allow building against - different versions of the `directory` library. - - + Added `Text.Pandoc.Compat.Except` to allow building against - different verions of `mtl`. - - * Templates: + [template changes] - + Added haddock template. - + EPUB3: Added `type` attribute to `link` tags. They are supposed to - be "advisory" in HTML5, but kindlegen seems to require them. - + LaTeX: Made `\subtitle` work properly (#1327). - + LaTeX/Beamer: remove conditional around date (#1321). - + LaTeX: Added `lot` and `lof` variables, which can be set to - get `\listoftables` and `\listoffigures` (#1407). Note that - these variables can be set at the command line with `-Vlot -Vlof` - or in YAML metadata. + * Added haddock template. + * EPUB3: Added `type` attribute to `link` tags. They are supposed to + be "advisory" in HTML5, but kindlegen seems to require them. + * LaTeX: Made `\subtitle` work properly (#1327). + * LaTeX/Beamer: remove conditional around date (#1321). + * LaTeX: Added `lot` and `lof` variables, which can be set to + get `\listoftables` and `\listoffigures` (#1407). Note that + these variables can be set at the command line with `-Vlot -Vlof` + or in YAML metadata. - * Code cleanup in some writers, using Reader monad to avoid - passing options parameter around (Matej Kollar). + [under the hood improvements] * Rewrote normalize for efficiency (#1385). - + Added `normalizeInlines`, `normalizeBlocks`. - + `normalize` is now `Pandoc -> Pandoc` instead of - `Data a :: a -> a`. Some users may need to change their uses of - `normalize` to the newly exported `normalizeInlines` or - `normalizeBlocks`. - + `normalize`: consolidate adjacent `RawBlock`s when possible. + * Rewrote Haddock reader to use `haddock-library` (#1346). - * `--filter`: + + This brings pandoc's rendering of haddock markup in line + with the new haddock. + + Fixed line breaks in `@` code blocks. + + alex and happy are no longer build-depends. - + Don't search PATH for a filter with an explicit path. - This fixed a bug wherein `--filter ./caps.py` would run `caps.py` from - the system path, even if there was a `caps.py` in the working directory. - + Respect shebang if filter is executable (#1389). - + Don't print misleading error message. - Previously pandoc would say that a filter was not found, - even in a case where the filter had a syntax error. + * Added `Text.Pandoc.Compat.Directory` to allow building against + different versions of the `directory` library. - * Avoid `import Prelude hiding (catch)` (#1309, thanks to Michael Thompson). + + Added `Text.Pandoc.Compat.Except` to allow building against + different verions of `mtl`. - * Don't strip path off of `writerSourceURL`: the path is needed to - resolve relative URLs when we fetch resources (#750). + * Code cleanup in some writers, using Reader monad to avoid + passing options parameter around (Matej Kollar). - * README: + * Improved readability in `pandoc.hs`. - + Made headers for all extensions so they have IDs and can be linked - to (Beni Cherniavsky-Paskin). - + Fixed typos (Phillip Alday). - + Fixed documentation of attributes (#1315). - + Clarified documentation on small caps (#1360). - + Better documentation for `fenced_code_attributes` extension - (Caleb McDaniel). - + Documented fact that you can put YAML metadata in a separate file - (#1412). + * Miscellaneous code cleanups (Artyom Kazak). + + * Avoid `import Prelude hiding (catch)` (#1309, thanks to Michael + Thompson). * Changed `http-conduit` flag to `https`. Depend on `http-client` and `http-client-tls` instead of `http-conduit`. (Note: pandoc still @@ -436,11 +504,18 @@ pandoc (1.13) `\left` to be used with `]`, `)` etc. (#1319), among many other improvements. - * Improved readability in `pandoc.hs`. + * Require latest `zip-archive`. This has fixes for unicode path names. - * Miscellaneous code cleanups (Artyom Kazak). + * Added tests for plain writer. - * Require latest `zip-archive`. This has fixes for unicode path names. + * `Text.Pandoc.Templates`: + + + Fail informatively on template syntax errors. + With the move from parsec to attoparsec, we lost good error + reporting. In fact, since we weren't testing for end of input, + malformed templates would fail silently. Here we revert back to + Parsec for better error messages. + + Use `ordNub` (#1022). * Benchmarks: @@ -457,11 +532,23 @@ pandoc (1.13) + Use one install command for pandoc, pandoc-citeproc. + Force install of pandoc-citeproc. - * `make_osx_package`: Call zip file pandoc-VERSION-osx.zip. - The zip should not be named SOMETHING.pkg.zip, or OSX finder - will extract it into a folder named SOMETHING.pkg, which it + * `make_osx_package`: Call zip file `pandoc-VERSION-osx.zip`. + The zip should not be named `SOMETHING.pkg.zip`, or OSX finder + will extract it into a folder named `SOMETHING.pkg`, which it will interpret as a defective package (#1308). + * `README`: + + + Made headers for all extensions so they have IDs and can be + linked to (Beni Cherniavsky-Paskin). + + Fixed typos (Phillip Alday). + + Fixed documentation of attributes (#1315). + + Clarified documentation on small caps (#1360). + + Better documentation for `fenced_code_attributes` extension + (Caleb McDaniel). + + Documented fact that you can put YAML metadata in a separate file + (#1412). + pandoc (1.12.4.2) @@ -935,8 +1022,6 @@ pandoc (1.12.3) should again work, and take precedence over a stylesheet specified in the metadata. - * `Text.Pandoc.Pretty`: Added `nestle`. API change. - * `Text.Pandoc.MIME`: Added `wmf`, `emf`. * `Text.Pandoc.Shared`: `fetchItem` now handles image URLs beginning @@ -1090,16 +1175,6 @@ pandoc (1.12.2) * DocBook reader: Handle numerical attributes starting with decimal. Also use `safeRead` instead of `read`. - * `Text.Pandoc.Parsing`: - - + Generalized type of `registerHeader`, using new type classes - `HasReadeOptions`, `HasIdentifierList`, `HasHeaderMap`. - These allow certain common functions to be reused - even in parsers that use custom state (instead of `ParserState`), - such as the MediaWiki reader. - + Moved inlineMath, displayMath from Markdown reader to Parsing. - Generalize their types and export them from Parsing. (API change.) - * `Text.Pandoc.Readers.TexMath`: Export `readTeXMath'`, which attends to display/inline. Deprecate `readTeXMath`, and use `readTeXMath'` in all the writers. Require `texmath >= 0.6.5.2`. diff --git a/src/Text/Pandoc/Readers/DocBook.hs b/src/Text/Pandoc/Readers/DocBook.hs index 1e119e729..59ff3e717 100644 --- a/src/Text/Pandoc/Readers/DocBook.hs +++ b/src/Text/Pandoc/Readers/DocBook.hs @@ -6,6 +6,7 @@ import Text.Pandoc.Definition import Text.Pandoc.Builder import Text.XML.Light import Text.Pandoc.Compat.TagSoupEntity (lookupEntity) +import Data.Either (rights) import Data.Generics import Data.Monoid import Data.Char (isSpace) @@ -13,6 +14,7 @@ import Control.Monad.State import Control.Applicative ((<$>)) import Data.List (intersperse) import Data.Maybe (fromMaybe) +import Text.TeXMath (readMathML, writeTeX) {- @@ -126,7 +128,7 @@ List of all DocBook tags, with [x] indicating implemented, [ ] envar - A software environment variable [x] epigraph - A short inscription at the beginning of a document or component note: also handle embedded attribution tag -[ ] equation - A displayed mathematical equation +[x] equation - A displayed mathematical equation [ ] errorcode - An error code [ ] errorname - An error name [ ] errortext - An error message. @@ -185,12 +187,12 @@ List of all DocBook tags, with [x] indicating implemented, [x] indexinfo - Meta-information for an Index [x] indexterm - A wrapper for terms to be indexed [x] info - A wrapper for information about a component or other block. (DocBook v5) -[ ] informalequation - A displayed mathematical equation without a title +[x] informalequation - A displayed mathematical equation without a title [ ] informalexample - A displayed example without a title [ ] informalfigure - A untitled figure [ ] informaltable - A table without a title [ ] initializer - The initializer for a FieldSynopsis -[ ] inlineequation - A mathematical equation or expression occurring inline +[x] inlineequation - A mathematical equation or expression occurring inline [ ] inlinegraphic - An object containing or pointing to graphical data that will be rendered inline [x] inlinemediaobject - An inline media object (video, audio, image, and so on) @@ -239,7 +241,7 @@ List of all DocBook tags, with [x] indicating implemented, [ ] methodname - The name of a method [ ] methodparam - Parameters to a method [ ] methodsynopsis - A syntax summary for a method -[ ] mml:math - A MathML equation +[x] mml:math - A MathML equation [ ] modespec - Application-specific information necessary for the completion of an OLink [ ] modifier - Modifiers in a synopsis @@ -882,6 +884,9 @@ parseInline (CRef ref) = return $ maybe (text $ map toUpper ref) (text . (:[])) $ lookupEntity ref parseInline (Elem e) = case qName (elName e) of + "equation" -> equation displayMath + "informalequation" -> equation displayMath + "inlineequation" -> equation math "subscript" -> subscript <$> innerInlines "superscript" -> superscript <$> innerInlines "inlinemediaobject" -> getImage e @@ -943,6 +948,13 @@ parseInline (Elem e) = _ -> innerInlines where innerInlines = (trimInlines . mconcat) <$> (mapM parseInline $ elContent e) + equation constructor = return $ mconcat $ + map (constructor . writeTeX) + $ rights + $ map (readMathML . showElement . everywhere (mkT removePrefix)) + $ filterChildren (\x -> qName (elName x) == "math" && + qPrefix (elName x) == Just "mml") e + removePrefix elname = elname { qPrefix = Nothing } codeWithLang = do let classes' = case attrValue "language" e of "" -> [] diff --git a/src/Text/Pandoc/Readers/Docx.hs b/src/Text/Pandoc/Readers/Docx.hs index c856ca30a..9943ebeb8 100644 --- a/src/Text/Pandoc/Readers/Docx.hs +++ b/src/Text/Pandoc/Readers/Docx.hs @@ -462,7 +462,7 @@ bodyPartToBlocks (Paragraph pPr parparts) bodyPartToBlocks (Paragraph pPr parparts) = do ils <- parPartsToInlines parparts >>= (return . normalizeSpaces) dropIls <- gets docxDropCap - let ils' = reduceList $ dropIls ++ ils + let ils' = concatR dropIls ils if dropCap pPr then do modify $ \s -> s { docxDropCap = ils' } return [] diff --git a/src/Text/Pandoc/Readers/Docx/Reducible.hs b/src/Text/Pandoc/Readers/Docx/Reducible.hs index a852e25bf..39a93d988 100644 --- a/src/Text/Pandoc/Readers/Docx/Reducible.hs +++ b/src/Text/Pandoc/Readers/Docx/Reducible.hs @@ -39,6 +39,7 @@ module Text.Pandoc.Readers.Docx.Reducible ((<++>), innards, reduceList, reduceListB, + concatR, rebuild) where @@ -78,6 +79,15 @@ reduceList' as (x:xs) = reduceList' (init as ++ (last as <++> x) ) xs reduceList :: (Reducible a) => [a] -> [a] reduceList = reduceList' [] +concatR :: (Reducible a) => [a] -> [a] -> [a] +concatR [] [] = [] +concatR [] ss = ss +concatR rs [] = rs +concatR rs ss = let (x:xs) = reverse rs + (y:ys) = ss + in + reverse xs ++ ( x <++> y ) ++ ys + combineReducibles :: (Reducible a, Eq a) => a -> a -> [a] combineReducibles r s = let (conts, rs) = topLevelContainers r diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 861f81b23..26ea764be 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -141,14 +141,16 @@ nonindentSpaces = do then return sps else unexpected "indented line" -skipNonindentSpaces :: MarkdownParser () +-- returns number of spaces parsed +skipNonindentSpaces :: MarkdownParser Int skipNonindentSpaces = do tabStop <- getOption readerTabStop - atMostSpaces (tabStop - 1) + atMostSpaces (tabStop - 1) <* notFollowedBy (char ' ') -atMostSpaces :: Int -> MarkdownParser () -atMostSpaces 0 = notFollowedBy (char ' ') -atMostSpaces n = (char ' ' >> atMostSpaces (n-1)) <|> return () +atMostSpaces :: Int -> MarkdownParser Int +atMostSpaces n + | n > 0 = (char ' ' >> (+1) <$> atMostSpaces (n-1)) <|> return 0 + | otherwise = return 0 litChar :: MarkdownParser Char litChar = escapedChar' @@ -717,35 +719,42 @@ blockQuote = do bulletListStart :: MarkdownParser () bulletListStart = try $ do optional newline -- if preceded by a Plain block in a list context + startpos <- sourceColumn <$> getPosition skipNonindentSpaces notFollowedBy' (() <$ hrule) -- because hrules start out just like lists satisfy isBulletListMarker - spaceChar <|> lookAhead newline - skipSpaces + endpos <- sourceColumn <$> getPosition + tabStop <- getOption readerTabStop + lookAhead (newline <|> spaceChar) + () <$ atMostSpaces (tabStop - (endpos - startpos)) anyOrderedListStart :: MarkdownParser (Int, ListNumberStyle, ListNumberDelim) anyOrderedListStart = try $ do optional newline -- if preceded by a Plain block in a list context + startpos <- sourceColumn <$> getPosition skipNonindentSpaces notFollowedBy $ string "p." >> spaceChar >> digit -- page number - (guardDisabled Ext_fancy_lists >> - do many1 digit - char '.' - spaceChar - return (1, DefaultStyle, DefaultDelim)) - <|> do (num, style, delim) <- anyOrderedListMarker - -- if it could be an abbreviated first name, insist on more than one space - if delim == Period && (style == UpperAlpha || (style == UpperRoman && - num `elem` [1, 5, 10, 50, 100, 500, 1000])) - then char '\t' <|> (try $ char ' ' >> spaceChar) - else spaceChar - skipSpaces - return (num, style, delim) + res <- do guardDisabled Ext_fancy_lists + many1 digit + char '.' + return (1, DefaultStyle, DefaultDelim) + <|> do (num, style, delim) <- anyOrderedListMarker + -- if it could be an abbreviated first name, + -- insist on more than one space + when (delim == Period && (style == UpperAlpha || + (style == UpperRoman && + num `elem` [1, 5, 10, 50, 100, 500, 1000]))) $ + () <$ spaceChar + return (num, style, delim) + endpos <- sourceColumn <$> getPosition + tabStop <- getOption readerTabStop + lookAhead (newline <|> spaceChar) + atMostSpaces (tabStop - (endpos - startpos)) + return res listStart :: MarkdownParser () listStart = bulletListStart <|> (anyOrderedListStart >> return ()) --- parse a line of a list item (start = parser for beginning of list item) listLine :: MarkdownParser String listLine = try $ do notFollowedBy' (do indentSpaces @@ -753,19 +762,21 @@ listLine = try $ do listStart) notFollowedByHtmlCloser optional (() <$ indentSpaces) - chunks <- manyTill + listLineCommon + +listLineCommon :: MarkdownParser String +listLineCommon = concat <$> manyTill ( many1 (satisfy $ \c -> c /= '\n' && c /= '<') <|> liftM snd (htmlTag isCommentTag) <|> count 1 anyChar ) newline - return $ concat chunks -- parse raw text for one list item, excluding start marker and continuations rawListItem :: MarkdownParser a -> MarkdownParser String rawListItem start = try $ do start - first <- listLine + first <- listLineCommon rest <- many (notFollowedBy listStart >> notFollowedBy blankline >> listLine) blanks <- many blankline return $ unlines (first:rest) ++ blanks @@ -823,8 +834,14 @@ orderedList = try $ do items <- fmap sequence $ many1 $ listItem ( try $ do optional newline -- if preceded by Plain block in a list + startpos <- sourceColumn <$> getPosition skipNonindentSpaces - orderedListMarker style delim ) + res <- orderedListMarker style delim + endpos <- sourceColumn <$> getPosition + tabStop <- getOption readerTabStop + lookAhead (newline <|> spaceChar) + atMostSpaces (tabStop - (endpos - startpos)) + return res ) start' <- option 1 $ guardEnabled Ext_startnum >> return start return $ B.orderedListWith (start', style, delim) <$> fmap compactify' items diff --git a/src/Text/Pandoc/Writers/ConTeXt.hs b/src/Text/Pandoc/Writers/ConTeXt.hs index 3b321cc19..bbca7f858 100644 --- a/src/Text/Pandoc/Writers/ConTeXt.hs +++ b/src/Text/Pandoc/Writers/ConTeXt.hs @@ -297,7 +297,7 @@ inlineToConTeXt (Link txt (('#' : ref), _)) = do <> brackets (text ref) inlineToConTeXt (Link txt (src, _)) = do - let isAutolink = txt == [Str src] + let isAutolink = txt == [Str (unEscapeString src)] st <- get let next = stNextRef st put $ st {stNextRef = next + 1} diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 36ce2ba21..9ead604d7 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -40,7 +40,7 @@ import Text.Pandoc.Slides import Text.Pandoc.Highlighting ( highlight, styleToCss, formatHtmlInline, formatHtmlBlock ) import Text.Pandoc.XML (fromEntities, escapeStringForXML) -import Network.URI ( parseURIReference, URI(..) ) +import Network.URI ( parseURIReference, URI(..), unEscapeString ) import Network.HTTP ( urlEncode ) import Numeric ( showHex ) import Data.Char ( ord, toLower ) @@ -361,13 +361,13 @@ obfuscateLink opts txt s = ReferenceObfuscation -> -- need to use preEscapedString or &'s are escaped to & in URL preEscapedString $ "<a href=\"" ++ (obfuscateString s') - ++ "\">" ++ (obfuscateString txt) ++ "</a>" + ++ "\" class=\"email\">" ++ (obfuscateString txt) ++ "</a>" JavascriptObfuscation -> (H.script ! A.type_ "text/javascript" $ preEscapedString ("\n<!--\nh='" ++ obfuscateString domain ++ "';a='" ++ at' ++ "';n='" ++ obfuscateString name' ++ "';e=n+a+h;\n" ++ - "document.write('<a h'+'ref'+'=\"ma'+'ilto'+':'+e+'\">'+" ++ + "document.write('<a h'+'ref'+'=\"ma'+'ilto'+':'+e+'\" clas'+'s=\"em' + 'ail\">'+" ++ linkText ++ "+'<\\/'+'a'+'>');\n// -->\n")) >> H.noscript (preEscapedString $ obfuscateString altText) _ -> error $ "Unknown obfuscation method: " ++ show meth @@ -739,9 +739,12 @@ inlineToHtml opts inline = RevealJsSlides -> '#':'/':xs _ -> s let link = H.a ! A.href (toValue s') $ linkText + let link' = if txt == [Str (unEscapeString s)] + then link ! A.class_ "uri" + else link return $ if null tit - then link - else link ! A.title (toValue tit) + then link' + else link' ! A.title (toValue tit) (Image txt (s,tit)) | treatAsImage s -> do let alternate' = stringify txt let attributes = [A.src $ toValue s] ++ diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index 3ed20ae87..5e4966abb 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -793,12 +793,17 @@ inlineToLaTeX (Note contents) = do (CodeBlock _ _ : _) -> cr _ -> empty let noteContents = nest 2 contents' <> optnl + opts <- gets stOptions + -- in beamer slides, display footnote from current overlay forward + let beamerMark = if writerBeamer opts + then text "<.->" + else empty modify $ \st -> st{ stNotes = noteContents : stNotes st } return $ if inMinipage then "\\footnotemark{}" -- note: a \n before } needed when note ends with a Verbatim environment - else "\\footnote" <> braces noteContents + else "\\footnote" <> beamerMark <> braces noteContents protectCode :: [Inline] -> [Inline] protectCode [] = [] diff --git a/tests/docbook-reader.docbook b/tests/docbook-reader.docbook index aef632fb1..9ba965d9b 100644 --- a/tests/docbook-reader.docbook +++ b/tests/docbook-reader.docbook @@ -731,6 +731,54 @@ These should not be escaped: \$ \\ \> \[ \{ Ellipses…and…and…. </para> </sect1> +<sect1 id="math"> + <para> + <equation> + <mml:math> + <mml:mrow> + <mml:mi>e</mml:mi> + <mml:mo>=</mml:mo> + <mml:mi>m</mml:mi> + <mml:msup> + <mml:mi>c</mml:mi> + <mml:mn>2</mml:mn> + </mml:msup> + </mml:mrow> + </mml:math> + <mml:math> + <mrow> + <mn>1</mn> + </mrow> + </mml:math> + </equation> + <inlineequation> + <mml:math> + <mml:mrow> + <mml:mi>e</mml:mi> + <mml:mo>=</mml:mo> + <mml:mi>m</mml:mi> + <mml:msup> + <mml:mi>c</mml:mi> + <mml:mn>2</mml:mn> + </mml:msup> + </mml:mrow> + </mml:math> + </inlineequation> + <informalequation> + <mml:math> + <mml:mrow> + <mml:mi>e</mml:mi> + <mml:mo>=</mml:mo> + <mml:mi>m</mml:mi> + <mml:msup> + <mml:mi>c</mml:mi> + <mml:mn>2</mml:mn> + </mml:msup> + </mml:mrow> + </mml:math> + </informalequation> + </para> +</sect1> <sect1 id="special-characters"> <title>Special Characters</title> <para> diff --git a/tests/docbook-reader.native b/tests/docbook-reader.native index 583b016bb..90d76b3c2 100644 --- a/tests/docbook-reader.native +++ b/tests/docbook-reader.native @@ -190,6 +190,8 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Spa ,Para [Str "Some",Space,Str "dashes:",Space,Str "one\8212two",Space,Str "\8212",Space,Str "three\8212four",Space,Str "\8212",Space,Str "five."] ,Para [Str "Dashes",Space,Str "between",Space,Str "numbers:",Space,Str "5\8211\&7,",Space,Str "255\8211\&66,",Space,Str "1987\8211\&1999."] ,Para [Str "Ellipses\8230and\8230and\8230."] +,Header 1 ("",[],[]) [] +,Para [Math DisplayMath "e = mc^{2}",Math DisplayMath "1",Space,Math InlineMath "e = mc^{2}",Space,Math DisplayMath "e = mc^{2}"] ,Header 1 ("",[],[]) [Str "Special",Space,Str "Characters"] ,Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "unicode:"] ,BulletList diff --git a/tests/markdown-reader-more.native b/tests/markdown-reader-more.native index b4713bc93..3e171e085 100644 --- a/tests/markdown-reader-more.native +++ b/tests/markdown-reader-more.native @@ -22,6 +22,15 @@ ,BulletList [[Plain [Str "one",Space,RawInline (Format "html") "<!--\n- two\n-->"]] ,[Plain [Str "three"]]] +,Header 2 ("indented-code-at-beginning-of-list",[],[]) [Str "Indented",Space,Str "code",Space,Str "at",Space,Str "beginning",Space,Str "of",Space,Str "list"] +,BulletList + [[CodeBlock ("",[],[]) "code\ncode"]] +,OrderedList (1,Decimal,Period) + [[CodeBlock ("",[],[]) "code\ncode"] + ,[CodeBlock ("",[],[]) "code\ncode"]] +,BulletList + [[CodeBlock ("",[],[]) "code\ncode"] + ,[Plain [Str "no",Space,Str "code"]]] ,Header 2 ("backslash-newline",[],[]) [Str "Backslash",Space,Str "newline"] ,Para [Str "hi",LineBreak,Str "there"] ,Header 2 ("code-spans",[],[]) [Str "Code",Space,Str "spans"] diff --git a/tests/markdown-reader-more.txt b/tests/markdown-reader-more.txt index 4cd69c9d8..e1ad4f3e6 100644 --- a/tests/markdown-reader-more.txt +++ b/tests/markdown-reader-more.txt @@ -70,6 +70,22 @@ $PATH 90 $PATH --> - three +## Indented code at beginning of list + +- code + code + + 1. code + code + + 12345678. code + code + + - code + code + + - no code + ## Backslash newline hi\ diff --git a/tests/writer.html b/tests/writer.html index bbe835720..8b0877f33 100644 --- a/tests/writer.html +++ b/tests/writer.html @@ -480,7 +480,7 @@ Blah <p><script type="text/javascript"> <!-- h='nowhere.net';a='@';n='nobody';e=n+a+h; -document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+'Email link'+'<\/'+'a'+'>'); +document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'" clas'+'s="em' + 'ail">'+'Email link'+'<\/'+'a'+'>'); // --> </script><noscript>Email link (nobody at nowhere dot net)</noscript></p> <p><a href="">Empty</a>.</p> @@ -503,20 +503,20 @@ document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+'Email link'+'<\/'+'a'+'>') <p>Here’s an <a href="/script?foo=1&bar=2">inline link</a>.</p> <p>Here’s an <a href="/script?foo=1&bar=2">inline link in pointy braces</a>.</p> <h2 id="autolinks">Autolinks</h2> -<p>With an ampersand: <a href="http://example.com/?foo=1&bar=2">http://example.com/?foo=1&bar=2</a></p> +<p>With an ampersand: <a href="http://example.com/?foo=1&bar=2" class="uri">http://example.com/?foo=1&bar=2</a></p> <ul> <li>In a list?</li> -<li><a href="http://example.com/">http://example.com/</a></li> +<li><a href="http://example.com/" class="uri">http://example.com/</a></li> <li>It should.</li> </ul> <p>An e-mail address: <script type="text/javascript"> <!-- h='nowhere.net';a='@';n='nobody';e=n+a+h; -document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+e+'<\/'+'a'+'>'); +document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'" clas'+'s="em' + 'ail">'+e+'<\/'+'a'+'>'); // --> </script><noscript>nobody at nowhere dot net</noscript></p> <blockquote> -<p>Blockquoted: <a href="http://example.com/">http://example.com/</a></p> +<p>Blockquoted: <a href="http://example.com/" class="uri">http://example.com/</a></p> </blockquote> <p>Auto-links should not occur here: <code><http://example.com/></code></p> <pre><code>or here: <http://example.com/></code></pre> |