pandoc 1.15.0.5 → 1.15.0.6
raw patch · 14 files changed
+225/−58 lines, 14 filesdep ~cmarkdep ~vectorPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: cmark, vector
API changes (from Hackage documentation)
Files
- README +6/−4
- changelog +42/−0
- data/dzslides/template.html +128/−30
- man/pandoc.1 +6/−4
- pandoc.cabal +3/−3
- src/Text/Pandoc/Parsing.hs +2/−3
- src/Text/Pandoc/Readers/Markdown.hs +2/−0
- src/Text/Pandoc/SelfContained.hs +2/−1
- src/Text/Pandoc/Shared.hs +5/−0
- src/Text/Pandoc/Writers/CommonMark.hs +4/−4
- src/Text/Pandoc/Writers/DokuWiki.hs +1/−1
- src/Text/Pandoc/Writers/HTML.hs +1/−0
- tests/Tests/Readers/Markdown.hs +16/−1
- tests/writer.dokuwiki +7/−7
README view
@@ -1,6 +1,6 @@ % Pandoc User's Guide % John MacFarlane-% July 02, 2015+% July 15, 2015 Synopsis ========@@ -411,12 +411,14 @@ `-D` *FORMAT*, `--print-default-template=`*FORMAT* -: Print the default template for an output *FORMAT*. (See `-t`- for a list of possible *FORMAT*s.)+: Print the system default template for an output *FORMAT*. (See `-t`+ for a list of possible *FORMAT*s.) Templates in the user data+ directory are ignored. `--print-default-data-file=`*FILE* -: Print a default data file.+: Print a system default data file. Files in the user data directory+ are ignored. `--no-wrap`
changelog view
@@ -1,3 +1,45 @@+pandoc (1.15.0.6)++ * `--self-contained`: Fixed overaggressive CSS minimization (#2301, 2286).+ Previously `--self-contained` wiped out all spaces in CSS,+ including semantically significant spaces. This was a regression+ from 1.14.x.++ * Markdown reader: don't allow bare URI links or autolinks in link+ label (#2300). Added test cases.++ * `Text.Pandoc.Parsing`, `uri`: Improved bare autolink detection (#2299).+ Previously we disallowed `-` at the end of an autolink,+ and disallowed the combination `=-`. This commit liberalizes the+ rules for allowing punctuation in a bare URI, and adds test cases.+ One potential drawback is that you can no longer put a bare+ URI in em dashes like this:+ `this uri---http://example.com---is an example.`+ But in this respect we now match github's treatment of bare URIs.++ * HTML writer: support speaker notes in dzslides.+ With this change `<div class="notes">` and also `<div class="notes"+ role="note">` will be output if `-t dzslides` is used. So we can+ have speaker notes in dzslides too. Thanks to maybegeek.++ * Updated dzslides template.++ * Improved documentation of options to print system default files (#2298).+ `--print-default-data-file` and `--print-default-template`.++ * DokuWiki writer: use `$..$` for Math instead of `<math>..</math>`+ (Tiziano Müller). MathJax seems currently to be the only maintained+ math rendering extension for DokuWiki.++ * `Text.Pandoc.Shared`: Changed `hierarchicalize` so it treats references+ div as top-level header (#2294). This fixes a bug with `--section-divs`,+ where the final references section added by pandoc-citeproc, enclosed in+ its own div, got nested in the div for the section previous to it.++ * Allow vector 0.11.++ * Require cmark > 0.4.+ pandoc (1.15.0.5) * HTML writer: Fixed email javascript obfuscation with `mailto:`
data/dzslides/template.html view
@@ -23,14 +23,23 @@ <li>Item 1 <li>Item 2 <li>Item 3+ <ul class="incremental">+ <li> Item 3.1+ <li> Item 3.2+ </ul> </ul>- <details>Some notes. They are only visible using onstage shell.</details>+ <div role="note">Some notes. They are only visible using onstage shell.</div> </section> <section>- <q>+ <blockquote> Who's brave enough to fly into something we all keep calling a death sphere?- </q>+ </blockquote>+ <details>+ <p>In the onstage shell, notes scroll rather than overflow:</p>+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla ac dui eu est feugiat lacinia sit amet nec leo. Mauris eu ipsum leo. Nulla mi odio, cursus sed sollicitudin non, fringilla id magna. Suspendisse sit amet posuere elit. Maecenas iaculis, turpis a placerat imperdiet, libero lorem feugiat nisi, nec tincidunt diam nibh sit amet massa. Vestibulum quis adipiscing tellus. Maecenas sollicitudin sodales pulvinar. Donec dui ipsum, bibendum facilisis consequat interdum, tempus ut mauris. Aliquam ut dolor nec odio scelerisque bibendum quis in neque. Aliquam dui dui, pulvinar quis fermentum quis, gravida eu augue. Nunc tristique dolor a urna pulvinar bibendum. Curabitur mollis cursus neque, in scelerisque metus porta non. Donec tempor enim in nibh vestibulum et convallis nisi malesuada. Duis ut lectus sed metus venenatis porttitor id pharetra quam. Suspendisse sapien turpis, ornare in molestie et, gravida eget turpis.+ </p>+ </details> </section> <section>@@ -42,7 +51,7 @@ <img src="http://placekitten.com/g/800/600"> <figcaption>An image</figcaption> </figure>- <details>Kittens are so cute!</details>+ <div role="note">Kittens are so cute!</div> </section> <section>@@ -63,14 +72,28 @@ <link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet'> <style>- html { background-color: black; }- body { background-color: white; border-radius: 12px}+ html, .view body { background-color: black; counter-reset: slideidx; }+ body, .view section { background-color: white; border-radius: 12px } /* A section is a slide. It's size is 800x600, and this will never change */- section {+ section, .view head > title { /* The font from Google */ font-family: 'Oswald', arial, serif; font-size: 30px; }++ .view section:after {+ counter-increment: slideidx;+ content: counter(slideidx, decimal-leading-zero);+ position: absolute; bottom: -80px; right: 100px;+ color: white;+ }++ .view head > title {+ color: white;+ text-align: center;+ margin: 1em 0 1em 0;+ }+ h1, h2 { margin-top: 200px; text-align: center;@@ -83,27 +106,42 @@ ul { margin: 50px 200px; }+ li > ul {+ margin: 15px 50px;+ } p { margin: 75px; font-size: 50px; } - q {- display: block;- width: 100%;+ blockquote { height: 100%; background-color: black; color: white; font-size: 60px; padding: 50px; }+ blockquote:before {+ content: open-quote;+ }+ blockquote:after {+ content: close-quote;+ } /* Figures are displayed full-page, with the caption on top of the image/video */ figure { background-color: black;+ width: 100%;+ height: 100%; }+ figure > * {+ position: absolute;+ }+ figure > img, figure > video {+ width: 100%; height: 100%;+ } figcaption { margin: 70px; font-size: 50px;@@ -125,12 +163,22 @@ https://developer.mozilla.org/en/CSS/CSS_transitions How to use CSS3 Transitions: */ section {- -moz-transition: left 400ms linear 0s;- -webkit-transition: left 400ms linear 0s;- -ms-transition: left 400ms linear 0s;- transition: left 400ms linear 0s;+ -moz-transition: left 400ms linear 0s;+ -webkit-transition: left 400ms linear 0s;+ -ms-transition: left 400ms linear 0s;+ transition: left 400ms linear 0s; }+ .view section {+ -moz-transition: none;+ -webkit-transition: none;+ -ms-transition: none;+ transition: none;+ } + .view section[aria-selected] {+ border: 5px red solid;+ }+ /* Before */ section { left: -150%; } /* Now */@@ -176,21 +224,50 @@ <!-- Default Style --> <style> * { margin: 0; padding: 0; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }- details { display: none; }+ [role="note"] { display: none; } body { width: 800px; height: 600px; margin-left: -400px; margin-top: -300px; position: absolute; top: 50%; left: 50%; overflow: hidden;+ display: none; }+ .view body {+ position: static;+ margin: 0; padding: 0;+ width: 100%; height: 100%;+ display: inline-block;+ overflow: visible; overflow-x: hidden;+ /* undo Dz.onresize */+ transform: none !important;+ -moz-transform: none !important;+ -webkit-transform: none !important;+ -o-transform: none !important;+ -ms-transform: none !important;+ }+ .view head, .view head > title { display: block } section { position: absolute; pointer-events: none; width: 100%; height: 100%; }+ .view section {+ pointer-events: auto;+ position: static;+ width: 800px; height: 600px;+ margin: -150px -200px;+ float: left;++ transform: scale(.4);+ -moz-transform: scale(.4);+ -webkit-transform: scale(.4);+ -o-transform: scale(.4);+ -ms-transform: scale(.4);+ }+ .view section > * { pointer-events: none; } section[aria-selected] { pointer-events: auto; } html { overflow: hidden; }- body { display: none; }+ html.view { overflow: visible; } body.loaded { display: block; } .incremental {visibility: hidden; } .incremental[active] {visibility: visible; }@@ -202,15 +279,8 @@ -ms-transition: width 400ms linear 0s; transition: width 400ms linear 0s; }- figure {- width: 100%;- height: 100%;- }- figure > * {- position: absolute;- }- figure > img, figure > video {- width: 100%; height: 100%;+ .view #progress-bar {+ display: none; } </style> @@ -219,6 +289,7 @@ remoteWindows: [], idx: -1, step: 0,+ html: null, slides: null, progressBar : null, params: {@@ -228,14 +299,16 @@ Dz.init = function() { document.body.className = "loaded";- this.slides = $$("body > section");+ this.slides = Array.prototype.slice.call($$("body > section")); this.progressBar = $("#progress-bar");+ this.html = document.body.parentNode; this.setupParams(); this.onhashchange(); this.setupTouchEvents(); this.onresize();+ this.setupView(); }- + Dz.setupParams = function() { var p = window.location.search.substr(1).split('&'); p.forEach(function(e, i, a) {@@ -285,6 +358,10 @@ aEvent.preventDefault(); this.goFullscreen(); }+ if (aEvent.keyCode == 79) { // o+ aEvent.preventDefault();+ this.toggleView();+ } } /* Touch Events */@@ -318,6 +395,16 @@ } } + Dz.setupView = function() {+ document.body.addEventListener("click", function ( e ) {+ if (!Dz.html.classList.contains("view")) return;+ if (!e.target || e.target.nodeName != "SECTION") return;++ Dz.html.classList.remove("view");+ Dz.setCursor(Dz.slides.indexOf(e.target) + 1);+ }, false);+ }+ /* Adapt the size of the slides to the window */ Dz.onresize = function() {@@ -334,9 +421,9 @@ } - Dz.getDetails = function(aIdx) {+ Dz.getNotes = function(aIdx) { var s = $("section:nth-of-type(" + aIdx + ")");- var d = s.$("details");+ var d = s.$("[role='note']"); return d ? d.innerHTML : ""; } @@ -365,7 +452,7 @@ if (argv[0] === "GET_CURSOR" && argc === 1) this.postMsg(win, "CURSOR", this.idx + "." + this.step); if (argv[0] === "GET_NOTES" && argc === 1)- this.postMsg(win, "NOTES", this.getDetails(this.idx));+ this.postMsg(win, "NOTES", this.getNotes(this.idx)); } Dz.toggleContent = function() {@@ -449,6 +536,14 @@ this.setCursor(lastIdx, lastStep); } + Dz.toggleView = function() {+ this.html.classList.toggle("view");++ if (this.html.classList.contains("view")) {+ $("section[aria-selected]").scrollIntoView(true);+ }+ }+ Dz.setSlide = function(aIdx) { this.idx = aIdx; var old = $("section[aria-selected]");@@ -462,6 +557,9 @@ } if (next) { next.setAttribute("aria-selected", "true");+ if (this.html.classList.contains("view")) {+ next.scrollIntoView();+ } var video = next.$("video"); if (video && !!+this.params.autoplay) { video.play();
man/pandoc.1 view
@@ -1,5 +1,5 @@ .\"t-.TH PANDOC 1 "July 02, 2015" ""+.TH PANDOC 1 "July 15, 2015" "" .SH NAME pandoc - general markup converter .SH SYNOPSIS@@ -507,13 +507,15 @@ .RE .TP .B \f[C]\-D\f[] \f[I]FORMAT\f[], \f[C]\-\-print\-default\-template=\f[]\f[I]FORMAT\f[]-Print the default template for an output \f[I]FORMAT\f[].-(See \f[C]\-t\f[] for a list of possible \f[I]FORMAT\f[]s.)+Print the system default template for an output \f[I]FORMAT\f[].+(See \f[C]\-t\f[] for a list of possible \f[I]FORMAT\f[]s.) Templates in+the user data directory are ignored. .RS .RE .TP .B \f[C]\-\-print\-default\-data\-file=\f[]\f[I]FILE\f[]-Print a default data file.+Print a system default data file.+Files in the user data directory are ignored. .RS .RE .TP
pandoc.cabal view
@@ -1,5 +1,5 @@ Name: pandoc-Version: 1.15.0.5+Version: 1.15.0.6 Cabal-Version: >= 1.10 Build-Type: Custom License: GPL@@ -266,7 +266,7 @@ blaze-markup >= 0.5.1 && < 0.8, yaml >= 0.8.8.2 && < 0.9, scientific >= 0.2 && < 0.4,- vector >= 0.10 && < 0.11,+ vector >= 0.10 && < 0.12, hslua >= 0.3 && < 0.5, binary >= 0.5 && < 0.8, SHA >= 1.6 && < 1.7,@@ -275,7 +275,7 @@ deepseq-generics >= 0.1 && < 0.2, JuicyPixels >= 3.1.6.1 && < 3.3, filemanip >= 0.3 && < 0.4,- cmark >= 0.3.4 && < 0.4+ cmark >= 0.4.0.1 && < 0.5 if flag(old-locale) Build-Depends: old-locale >= 1 && < 1.1, time >= 1.2 && < 1.5
src/Text/Pandoc/Parsing.hs view
@@ -448,13 +448,12 @@ uri = try $ do scheme <- uriScheme char ':'- -- We allow punctuation except at the end, since+ -- We allow sentence punctuation except at the end, since -- we don't want the trailing '.' in 'http://google.com.' We want to allow -- http://en.wikipedia.org/wiki/State_of_emergency_(disambiguation) -- as a URL, while NOT picking up the closing paren in -- (http://wikipedia.org). So we include balanced parens in the URL.- let isWordChar c = isAlphaNum c || c == '_' || c == '/' || c == '+' ||- not (isAscii c)+ let isWordChar c = isAlphaNum c || c `elem` "#$%*+/@\\_-" let wordChar = satisfy isWordChar let percentEscaped = try $ char '%' >> skipMany1 (satisfy isHexDigit) let entity = () <$ characterReference
src/Text/Pandoc/Readers/Markdown.hs view
@@ -1752,12 +1752,14 @@ bareURL :: MarkdownParser (F Inlines) bareURL = try $ do guardEnabled Ext_autolink_bare_uris+ getState >>= guard . stateAllowLinks (orig, src) <- uri <|> emailAddress notFollowedBy $ try $ spaces >> htmlTag (~== TagClose "a") return $ return $ B.link src "" (B.str orig) autoLink :: MarkdownParser (F Inlines) autoLink = try $ do+ getState >>= guard . stateAllowLinks char '<' (orig, src) <- uri <|> emailAddress -- in rare cases, something may remain after the uri parser
src/Text/Pandoc/SelfContained.hs view
@@ -103,8 +103,9 @@ parseCSSUrls media sourceURL d = B.concat <$> P.many (pCSSWhite <|> pCSSComment <|> pCSSUrl media sourceURL d <|> pCSSOther) +-- Note: some whitespace in CSS is significant, so we can't collapse it! pCSSWhite :: ParsecT ByteString () IO ByteString-pCSSWhite = P.space >> P.spaces >> return B.empty+pCSSWhite = B.singleton <$> P.space <* P.spaces pCSSComment :: ParsecT ByteString () IO ByteString pCSSComment = P.try $ do
@@ -662,12 +662,17 @@ sectionContents' <- hierarchicalizeWithIds sectionContents rest' <- hierarchicalizeWithIds rest return $ Sec level newnum attr title' sectionContents' : rest'+hierarchicalizeWithIds ((Div ("",["references"],[])+ (Header level (ident,classes,kvs) title' : xs)):ys) =+ hierarchicalizeWithIds ((Header level (ident,("references":classes),kvs)+ title') : (xs ++ ys)) hierarchicalizeWithIds (x:rest) = do rest' <- hierarchicalizeWithIds rest return $ (Blk x) : rest' headerLtEq :: Int -> Block -> Bool headerLtEq level (Header l _ _) = l <= level+headerLtEq level (Div ("",["references"],[]) (Header l _ _ : _)) = l <= level headerLtEq _ _ = False -- | Generate a unique identifier from a list of inlines.
src/Text/Pandoc/Writers/CommonMark.hs view
@@ -76,8 +76,8 @@ $ node DOCUMENT (blocksToNodes bs) where cmarkOpts = [optHardBreaks | isEnabled Ext_hard_line_breaks opts] colwidth = if writerWrapText opts- then writerColumns opts- else 0+ then Just $ writerColumns opts+ else Nothing inlinesToCommonMark :: WriterOptions -> [Inline] -> Identity String inlinesToCommonMark opts ils = return $@@ -85,8 +85,8 @@ $ node PARAGRAPH (inlinesToNodes ils) where cmarkOpts = [optHardBreaks | isEnabled Ext_hard_line_breaks opts] colwidth = if writerWrapText opts- then writerColumns opts- else 0+ then Just $ writerColumns opts+ else Nothing blocksToNodes :: [Block] -> [Node] blocksToNodes = foldr blockToNodes []
src/Text/Pandoc/Writers/DokuWiki.hs view
@@ -451,7 +451,7 @@ inlineToDokuWiki _ (Str str) = return $ escapeString str -inlineToDokuWiki _ (Math _ str) = return $ "<math>" ++ str ++ "</math>"+inlineToDokuWiki _ (Math _ str) = return $ "$" ++ str ++ "$" -- note: str should NOT be escaped inlineToDokuWiki _ (RawInline f str)
src/Text/Pandoc/Writers/HTML.hs view
@@ -458,6 +458,7 @@ if speakerNotes then case writerSlideVariant opts of RevealJsSlides -> addAttrs opts' attr $ H5.aside $ contents'+ DZSlides -> addAttrs opts' attr $ H5.div $ contents' NoSlides -> addAttrs opts' attr $ H.div $ contents' _ -> mempty else addAttrs opts attr $ H.div $ contents'
tests/Tests/Readers/Markdown.hs view
@@ -119,6 +119,10 @@ autolink "http://business.timesonline.co.uk/article/0,,9065-2473189,00.html") , ("http://www.mail-archive.com/ruby-talk@ruby-lang.org/", autolink "http://www.mail-archive.com/ruby-talk@ruby-lang.org/")+ , ("https://example.org/?anchor=lala-",+ autolink "https://example.org/?anchor=lala-")+ , ("https://example.org/?anchor=-lala",+ autolink "https://example.org/?anchor=-lala") ] {-@@ -190,7 +194,7 @@ =?> para (link "/there.0" "" "hi") ] , testGroup "bare URIs"- (map testBareLink bareLinkTests)+ (map testBareLink bareLinkTests) , testGroup "autolinks" [ "with unicode dash following" =: "<http://foo.bar>\8212" =?> para (autolink "http://foo.bar" <>@@ -198,6 +202,17 @@ , "a partial URL (#2277)" =: "<www.boe.es/buscar/act.php?id=BOE-A-1996-8930#a66>" =?> para (text "<www.boe.es/buscar/act.php?id=BOE-A-1996-8930#a66>")+ ]+ , testGroup "links"+ [ "no autolink inside link" =:+ "[<https://example.org>](url)" =?>+ para (link "url" "" (text "<https://example.org>"))+ , "no inline link inside link" =:+ "[[a](url2)](url)" =?>+ para (link "url" "" (text "[a](url2)"))+ , "no bare URI inside link" =:+ "[https://example.org(](url)" =?>+ para (link "url" "" (text "https://example.org(")) ] , testGroup "Headers" [ "blank line before header" =:
tests/writer.dokuwiki view
@@ -454,13 +454,13 @@ ====== LaTeX ====== * - * <math>2+2=4</math>- * <math>x \in y</math>- * <math>\alpha \wedge \omega</math>- * <math>223</math>- * <math>p</math>-Tree- * Here’s some display math: <math>\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}</math>- * Here’s one that has a line break in it: <math>\alpha + \omega \times x^2</math>.+ * $2+2=4$+ * $x \in y$+ * $\alpha \wedge \omega$+ * $223$+ * $p$-Tree+ * Here’s some display math: $\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$+ * Here’s one that has a line break in it: $\alpha + \omega \times x^2$. These shouldn’t be math: