texlive[44097] Master/texmf-dist: markdown (28apr17)

commits+karl at tug.org commits+karl at tug.org
Fri Apr 28 23:15:29 CEST 2017


Revision: 44097
          http://tug.org/svn/texlive?view=revision&revision=44097
Author:   karl
Date:     2017-04-28 23:15:29 +0200 (Fri, 28 Apr 2017)
Log Message:
-----------
markdown (28apr17)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/generic/markdown/markdown.pdf
    trunk/Master/texmf-dist/source/generic/markdown/markdown.dtx
    trunk/Master/texmf-dist/tex/generic/markdown/markdown.tex
    trunk/Master/texmf-dist/tex/luatex/markdown/markdown.lua

Modified: trunk/Master/texmf-dist/doc/generic/markdown/markdown.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/generic/markdown/markdown.dtx
===================================================================
--- trunk/Master/texmf-dist/source/generic/markdown/markdown.dtx	2017-04-28 21:15:08 UTC (rev 44096)
+++ trunk/Master/texmf-dist/source/generic/markdown/markdown.dtx	2017-04-28 21:15:29 UTC (rev 44097)
@@ -111,7 +111,7 @@
     edition   = {3},
     isbn      = {0-201-13447-0},
     pagetotal = {ix, 479},
-    publisher = {Addison-Westley}}
+    publisher = {Addison-Wesley}}
 \end{filecontents}
 \usepackage[
   backend=biber,
@@ -156,7 +156,7 @@
 % \fi
 %  \begin{macrocode}
 local metadata = {
-    version   = "2.5.0",
+    version   = "2.5.1",
     comment   = "A module for the conversion from markdown to plain TeX",
     author    = "John MacFarlane, Hans Hagen, Vít Novotný",
     copyright = "2009-2017 John MacFarlane, Hans Hagen; " ..
@@ -719,8 +719,8 @@
 % \ref{sec:luaoptions}) used during the conversion from markdown to plain
 % \TeX{}, and for changing the way markdown the tokens are rendered.
 %  \begin{macrocode}
-\def\markdownLastModified{2017/04/10}%
-\def\markdownVersion{2.5.0}%
+\def\markdownLastModified{2017/04/27}%
+\def\markdownVersion{2.5.1}%
 %    \end{macrocode}
 %
 % The plain \TeX{} interface is implemented by the \t`markdown.tex` file that
@@ -2651,14 +2651,24 @@
      ["^"] = "\\markdownRendererCircumflex{}",
      ["\\"] = "\\markdownRendererBackslash{}",
      ["~"] = "\\markdownRendererTilde{}",
-     ["|"] = "\\markdownRendererPipe{}", }
-   local escaped_minimal_chars = {
+     ["|"] = "\\markdownRendererPipe{}",
+   }
+   local escaped_uri_chars = {
      ["{"] = "\\markdownRendererLeftBrace{}",
      ["}"] = "\\markdownRendererRightBrace{}",
      ["%"] = "\\markdownRendererPercentSign{}",
-     ["\\"] = "\\markdownRendererBackslash{}", }
+     ["\\"] = "\\markdownRendererBackslash{}",
+   }
+   local escaped_citation_chars = {
+     ["{"] = "\\markdownRendererLeftBrace{}",
+     ["}"] = "\\markdownRendererRightBrace{}",
+     ["%"] = "\\markdownRendererPercentSign{}",
+     ["#"] = "\\markdownRendererHash{}",
+     ["\\"] = "\\markdownRendererBackslash{}",
+   }
    local escaped_minimal_strings = {
-     ["^^"] = "\\markdownRendererCircumflex\\markdownRendererCircumflex ", }
+     ["^^"] = "\\markdownRendererCircumflex\\markdownRendererCircumflex ",
+   }
 %    \end{macrocode}
 % Use the \luam{escaped_chars} table to create an escaper function
 % \luamdef{escape} and the \luam{escaped_minimal_chars} and
@@ -2666,8 +2676,9 @@
 % \luamdef{escape_minimal}.
 %  \begin{macrocode}
   local escape = util.escaper(escaped_chars)
-  local escape_minimal = util.escaper(escaped_minimal_chars,
+  local escape_citation = util.escaper(escaped_citation_chars,
     escaped_minimal_strings)
+  local escape_uri = util.escaper(escaped_uri_chars, escaped_minimal_strings)
 %    \end{macrocode}
 %
 % Define \luamdef{writer->string} as a function that will transform an input
@@ -2678,10 +2689,12 @@
 %  \begin{macrocode}
   if options.hybrid then
     self.string = function(s) return s end
+    self.citation = function(c) return c end
     self.uri = function(u) return u end
   else
     self.string = escape
-    self.uri = escape_minimal
+    self.citation = escape_citation
+    self.uri = escape_uri
   end
 %    \end{macrocode}
 %
@@ -3026,7 +3039,7 @@
 parsers.alphanumeric           = R("AZ","az","09")
 parsers.keyword                = parsers.letter
                                * parsers.alphanumeric^0
-parsers.internal_punctuation   = S(":;,.#$%&-+?<>~/")
+parsers.internal_punctuation   = S(":;,.#$%&-+?<>~/_")
 
 parsers.doubleasterisks        = P("**")
 parsers.doubleunderscores      = P("__")
@@ -3143,7 +3156,21 @@
 parsers.fencedline   = function(char)
   return               C(parsers.line - parsers.fencetail(char))
                      / function(s)
-                           return s:gsub("^" .. string.rep(" ?", fenceindent), "")
+                         i = 1
+                         remaining = fenceindent
+                         while true do
+                           c = s:sub(i, i)
+                           if c == " " and remaining > 0 then
+                             remaining = remaining - 1
+                             i = i + 1
+                           elseif c == "\t" and remaining > 3 then
+                             remaining = remaining - 4
+                             i = i + 1
+                           else
+                             break
+                           end
+                         end
+                         return s:sub(i)
                        end
 end
 %    \end{macrocode}
@@ -3706,7 +3733,7 @@
           cites[#cites+1] = {
               prenote = normalize(raw_cites[i]),
               suppress_author = raw_cites[i+1] == "-",
-              name = writer.string(raw_cites[i+2]),
+              name = writer.citation(raw_cites[i+2]),
               postnote = normalize(raw_cites[i+3]),
           }
       end

Modified: trunk/Master/texmf-dist/tex/generic/markdown/markdown.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/markdown/markdown.tex	2017-04-28 21:15:08 UTC (rev 44096)
+++ trunk/Master/texmf-dist/tex/generic/markdown/markdown.tex	2017-04-28 21:15:29 UTC (rev 44097)
@@ -45,8 +45,8 @@
 %% 
 %% The names of the source files used are shown above.
 %% 
-\def\markdownLastModified{2017/04/10}%
-\def\markdownVersion{2.5.0}%
+\def\markdownLastModified{2017/04/27}%
+\def\markdownVersion{2.5.1}%
 \let\markdownBegin\relax
 \let\markdownEnd\relax
 \let\markdownInput\relax

Modified: trunk/Master/texmf-dist/tex/luatex/markdown/markdown.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/markdown/markdown.lua	2017-04-28 21:15:08 UTC (rev 44096)
+++ trunk/Master/texmf-dist/tex/luatex/markdown/markdown.lua	2017-04-28 21:15:29 UTC (rev 44097)
@@ -58,7 +58,7 @@
 -- those in the standard .ins files.
 -- 
 local metadata = {
-    version   = "2.5.0",
+    version   = "2.5.1",
     comment   = "A module for the conversion from markdown to plain TeX",
     author    = "John MacFarlane, Hans Hagen, Vít Novotný",
     copyright = "2009-2017 John MacFarlane, Hans Hagen; " ..
@@ -525,23 +525,36 @@
      ["^"] = "\\markdownRendererCircumflex{}",
      ["\\"] = "\\markdownRendererBackslash{}",
      ["~"] = "\\markdownRendererTilde{}",
-     ["|"] = "\\markdownRendererPipe{}", }
-   local escaped_minimal_chars = {
+     ["|"] = "\\markdownRendererPipe{}",
+   }
+   local escaped_uri_chars = {
      ["{"] = "\\markdownRendererLeftBrace{}",
      ["}"] = "\\markdownRendererRightBrace{}",
      ["%"] = "\\markdownRendererPercentSign{}",
-     ["\\"] = "\\markdownRendererBackslash{}", }
+     ["\\"] = "\\markdownRendererBackslash{}",
+   }
+   local escaped_citation_chars = {
+     ["{"] = "\\markdownRendererLeftBrace{}",
+     ["}"] = "\\markdownRendererRightBrace{}",
+     ["%"] = "\\markdownRendererPercentSign{}",
+     ["#"] = "\\markdownRendererHash{}",
+     ["\\"] = "\\markdownRendererBackslash{}",
+   }
    local escaped_minimal_strings = {
-     ["^^"] = "\\markdownRendererCircumflex\\markdownRendererCircumflex ", }
+     ["^^"] = "\\markdownRendererCircumflex\\markdownRendererCircumflex ",
+   }
   local escape = util.escaper(escaped_chars)
-  local escape_minimal = util.escaper(escaped_minimal_chars,
+  local escape_citation = util.escaper(escaped_citation_chars,
     escaped_minimal_strings)
+  local escape_uri = util.escaper(escaped_uri_chars, escaped_minimal_strings)
   if options.hybrid then
     self.string = function(s) return s end
+    self.citation = function(c) return c end
     self.uri = function(u) return u end
   else
     self.string = escape
-    self.uri = escape_minimal
+    self.citation = escape_citation
+    self.uri = escape_uri
   end
   function self.code(s)
     return {"\\markdownRendererCodeSpan{",escape(s),"}"}
@@ -764,7 +777,7 @@
 parsers.alphanumeric           = R("AZ","az","09")
 parsers.keyword                = parsers.letter
                                * parsers.alphanumeric^0
-parsers.internal_punctuation   = S(":;,.#$%&-+?<>~/")
+parsers.internal_punctuation   = S(":;,.#$%&-+?<>~/_")
 
 parsers.doubleasterisks        = P("**")
 parsers.doubleunderscores      = P("__")
@@ -872,7 +885,21 @@
 parsers.fencedline   = function(char)
   return               C(parsers.line - parsers.fencetail(char))
                      / function(s)
-                           return s:gsub("^" .. string.rep(" ?", fenceindent), "")
+                         i = 1
+                         remaining = fenceindent
+                         while true do
+                           c = s:sub(i, i)
+                           if c == " " and remaining > 0 then
+                             remaining = remaining - 1
+                             i = i + 1
+                           elseif c == "\t" and remaining > 3 then
+                             remaining = remaining - 4
+                             i = i + 1
+                           else
+                             break
+                           end
+                         end
+                         return s:sub(i)
                        end
 end
 parsers.leader      = parsers.space^-3
@@ -1343,7 +1370,7 @@
           cites[#cites+1] = {
               prenote = normalize(raw_cites[i]),
               suppress_author = raw_cites[i+1] == "-",
-              name = writer.string(raw_cites[i+2]),
+              name = writer.citation(raw_cites[i+2]),
               postnote = normalize(raw_cites[i+3]),
           }
       end



More information about the tex-live-commits mailing list