texlive[42652] Master/texmf-dist: markdown (8dec16)

commits+karl at tug.org commits+karl at tug.org
Fri Dec 9 00:00:36 CET 2016


Revision: 42652
          http://tug.org/svn/texlive?view=revision&revision=42652
Author:   karl
Date:     2016-12-09 00:00:36 +0100 (Fri, 09 Dec 2016)
Log Message:
-----------
markdown (8dec16)

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/latex/markdown/markdown.sty
    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	2016-12-08 01:02:34 UTC (rev 42651)
+++ trunk/Master/texmf-dist/source/generic/markdown/markdown.dtx	2016-12-08 23:00:36 UTC (rev 42652)
@@ -74,10 +74,10 @@
 \begin{filecontents}{markdown.bib}
   @book{luatex16,
     author    = {{Lua\TeX{} development team}},
-    title     = {Lua\TeX{} reference manual (0.98.3)},
-    date      = {2016-08-23},
+    title     = {Lua\TeX{} reference manual},
+    date      = {2016-09-27},
     url       = {http://www.luatex.org/svn/trunk/manual/luatex.pdf},
-    urldate   = {2016-08-30}}
+    urldate   = {2016-11-27}}
   @book{latex16,
     author    = {Braams, Johannes and Carlisle, David and Jeffrey, Alan and
                  Lamport, Leslie and Mittelbach, Frank and Rowley, Chris and
@@ -85,7 +85,7 @@
     title     = {The \Hologo{LaTeX2e} Sources},
     date      = {2016-03-31},
     url       = {http://mirrors.ctan.org/macros/latex/base/source2e.pdf},
-    urldate   = {2016-06-02}}
+    urldate   = {2016-09-27}}
   @book{ierusalimschy13,
     author    = {Ierusalimschy, Roberto},
     year      = {2013},
@@ -137,7 +137,7 @@
 % packages that enable the direct inclusion of markdown documents inside \TeX{}
 % documents.
 %
-% Architecturally, the package consists of the \pkg{Lunamark} v1.4.0 Lua module
+% Architecturally, the package consists of the \pkg{Lunamark} v0.5.0 Lua module
 % by John MacFarlane, which was slimmed down and rewritten for the needs of the
 % package. On top of \pkg{Lunamark} sits code for the plain \TeX{}, \LaTeX{},
 % and \Hologo{ConTeXt} formats by Vít Novotný.
@@ -147,7 +147,7 @@
 % \fi
 %  \begin{macrocode}
 local metadata = {
-    version   = "2.1.3",
+    version   = "2.2.1",
     comment   = "A module for the conversion from markdown to plain TeX",
     author    = "John MacFarlane, Hans Hagen, Vít Novotný",
     copyright = "2009-2016 John MacFarlane, Hans Hagen; 2016 Vít Novotný",
@@ -530,6 +530,20 @@
 defaultOptions.footnotes = false
 %    \end{macrocode}
 %
+%   \Optitem[false]{inlineFootnotes}{\opt{true}, \opt{false}}
+%     \begin{valuelist}
+%       \item[true] Enable the pandoc inline footnote syntax extension:
+%         \begin{Verbatim}
+% Here is an inline note.^[Inlines notes are easier to
+% write, since you don't have to pick an identifier and
+% move down to type the note.]
+%         \end{Verbatim}
+%       \item[false] Disable the pandoc inline footnote syntax extension.
+%     \end{valuelist}
+%  \begin{macrocode}
+defaultOptions.inlineFootnotes = false
+%    \end{macrocode}
+%
 %   \Optitem[false]{preserveTabs}{\opt{true}, \opt{false}}
 %     \begin{valuelist}
 %       \item[true] Preserve all tabs in the input.
@@ -586,8 +600,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{2016/09/15}%
-\def\markdownVersion{2.1.3}%
+\def\markdownLastModified{2016/12/07}%
+\def\markdownVersion{2.2.1}%
 %    \end{macrocode}
 %
 % The plain \TeX{} interface is implemented by the \t`markdown.tex` file that
@@ -732,6 +746,7 @@
 \let\markdownOptionFencedCode\undefined
 \let\markdownOptionHashEnumerators\undefined
 \let\markdownOptionHybrid\undefined
+\let\markdownOptionInlineFootnotes\undefined
 \let\markdownOptionPreserveTabs\undefined
 \let\markdownOptionSmartEllipses\undefined
 \let\markdownOptionStartNumber\undefined
@@ -1449,6 +1464,8 @@
   \def\markdownOptionHashEnumerators{#1}}%
 \define at key{markdownOptions}{hybrid}[true]{%
   \def\markdownOptionHybrid{#1}}%
+\define at key{markdownOptions}{inlineFotnotes}[true]{%
+  \def\markdownOptionInlineFootnotes{#1}}%
 \define at key{markdownOptions}{preserveTabs}[true]{%
   \def\markdownOptionPreserveTabs{#1}}%
 \define at key{markdownOptions}{smartEllipses}[true]{%
@@ -2424,6 +2441,100 @@
   return self
 end
 %    \end{macrocode}
+% \subsubsection{Generic \acro{peg} Patterns}
+% These \acro{peg} patterns have been temporarily moved outside the
+% \luam{reader.new} method, which is currently hitting the limit of 200 local
+% variables. To resolve this issue, all the \acro{peg} patterns local to
+% \luam{reader.new} will be moved to a static hash table at some point in the
+% future.
+%  \begin{macrocode}
+local percent                = P("%")
+local at                     = P("@")
+local comma                  = P(",")
+local asterisk               = P("*")
+local dash                   = P("-")
+local plus                   = P("+")
+local underscore             = P("_")
+local period                 = P(".")
+local hash                   = P("#")
+local ampersand              = P("&")
+local backtick               = P("`")
+local less                   = P("<")
+local more                   = P(">")
+local space                  = P(" ")
+local squote                 = P("'")
+local dquote                 = P('"')
+local lparent                = P("(")
+local rparent                = P(")")
+local lbracket               = P("[")
+local rbracket               = P("]")
+local circumflex             = P("^")
+local slash                  = P("/")
+local equal                  = P("=")
+local colon                  = P(":")
+local semicolon              = P(";")
+local exclamation            = P("!")
+local tilde                  = P("~")
+
+local digit                  = R("09")
+local hexdigit               = R("09","af","AF")
+local letter                 = R("AZ","az")
+local alphanumeric           = R("AZ","az","09")
+local keyword                = letter * alphanumeric^0
+local internal_punctuation   = S(":;,.#$%&-+?<>~/")
+
+local doubleasterisks        = P("**")
+local doubleunderscores      = P("__")
+local fourspaces             = P("    ")
+
+local any                    = P(1)
+local fail                   = any - 1
+local always                 = P("")
+
+local escapable              = S("\\`*_{}[]()+_.!<>#-~:^@;")
+
+local anyescaped             = P("\\") / "" * escapable
+                             + any
+
+local tab                    = P("\t")
+local spacechar              = S("\t ")
+local spacing                = S(" \n\r\t")
+local newline                = P("\n")
+local nonspacechar           = any - spacing
+local tightblocksep          = P("\001")
+
+local specialchar            = S("*_`&[]<!\\. at -^")
+
+local normalchar             = any -
+                               (specialchar + spacing + tightblocksep)
+local optionalspace          = spacechar^0
+local eof                    = - any
+local nonindentspace         = space^-3 * - spacechar
+local indent                 = space^-3 * tab
+                             + fourspaces / ""
+local linechar               = P(1 - newline)
+
+local blankline              = optionalspace * newline / "\n"
+local blanklines             = blankline^0
+local skipblanklines         = (optionalspace * newline)^0
+local indentedline           = indent    /"" * C(linechar^1 * newline^-1)
+local optionallyindentedline = indent^-1 /"" * C(linechar^1 * newline^-1)
+local sp                     = spacing^0
+local spnl                   = optionalspace * (newline * optionalspace)^-1
+local line                   = linechar^0 * newline
+                             + linechar^1 * eof
+local nonemptyline           = line - blankline
+
+local chunk = line * (optionallyindentedline - blankline)^0
+
+-- block followed by 0 or more optionally
+-- indented blocks with first line indented.
+local function indented_blocks(bl)
+  return Cs( bl
+           * (blankline^1 * indent * -blankline * bl)^0
+           * (blankline^1 + eof) )
+end
+%    \end{macrocode}
 % 
 % \subsubsection{Markdown Reader}\label{sec:markdownreader}
 % This section documents the \luam{reader} object, which implements the
@@ -2492,7 +2603,10 @@
   local syntax
   local blocks_toplevel
   local blocks
-  local inlines, inlines_no_link, inlines_nbsp
+  local inlines
+  local inlines_no_link
+  local inlines_no_inline_note
+  local inlines_nbsp
 
   local function create_parser(name, grammar)
     return function(str)
@@ -2513,98 +2627,12 @@
     function() return inlines end)
   local parse_inlines_no_link = create_parser("parse_inlines_no_link",
     function() return inlines_no_link end)
+  local parse_inlines_no_inline_note = create_parser(
+    "parse_inlines_no_inline_note",
+    function() return inlines_no_inline_note end)
   local parse_inlines_nbsp = create_parser("parse_inlines_nbsp",
     function() return inlines_nbsp end)
 %    \end{macrocode}
-% \paragraph{Generic \acro{peg} Patterns}
-%  \begin{macrocode}
-  local percent                = P("%")
-  local at                     = P("@")
-  local comma                  = P(",")
-  local asterisk               = P("*")
-  local dash                   = P("-")
-  local plus                   = P("+")
-  local underscore             = P("_")
-  local period                 = P(".")
-  local hash                   = P("#")
-  local ampersand              = P("&")
-  local backtick               = P("`")
-  local less                   = P("<")
-  local more                   = P(">")
-  local space                  = P(" ")
-  local squote                 = P("'")
-  local dquote                 = P('"')
-  local lparent                = P("(")
-  local rparent                = P(")")
-  local lbracket               = P("[")
-  local rbracket               = P("]")
-  local circumflex             = P("^")
-  local slash                  = P("/")
-  local equal                  = P("=")
-  local colon                  = P(":")
-  local semicolon              = P(";")
-  local exclamation            = P("!")
-  local tilde                  = P("~")
-
-  local digit                  = R("09")
-  local hexdigit               = R("09","af","AF")
-  local letter                 = R("AZ","az")
-  local alphanumeric           = R("AZ","az","09")
-  local keyword                = letter * alphanumeric^0
-  local internal_punctuation   = S(":;,.#$%&-+?<>~/")
-
-  local doubleasterisks        = P("**")
-  local doubleunderscores      = P("__")
-  local fourspaces             = P("    ")
-
-  local any                    = P(1)
-  local fail                   = any - 1
-  local always                 = P("")
-
-  local escapable              = S("\\`*_{}[]()+_.!<>#-~:^@;")
-
-  local anyescaped             = P("\\") / "" * escapable
-                               + any
-
-  local tab                    = P("\t")
-  local spacechar              = S("\t ")
-  local spacing                = S(" \n\r\t")
-  local newline                = P("\n")
-  local nonspacechar           = any - spacing
-  local tightblocksep          = P("\001")
-
-  local specialchar            = S("*_`&[]<!\\. at -")
-
-  local normalchar             = any -
-                                 (specialchar + spacing + tightblocksep)
-  local optionalspace          = spacechar^0
-  local eof                    = - any
-  local nonindentspace         = space^-3 * - spacechar
-  local indent                 = space^-3 * tab
-                               + fourspaces / ""
-  local linechar               = P(1 - newline)
-
-  local blankline              = optionalspace * newline / "\n"
-  local blanklines             = blankline^0
-  local skipblanklines         = (optionalspace * newline)^0
-  local indentedline           = indent    /"" * C(linechar^1 * newline^-1)
-  local optionallyindentedline = indent^-1 /"" * C(linechar^1 * newline^-1)
-  local sp                     = spacing^0
-  local spnl                   = optionalspace * (newline * optionalspace)^-1
-  local line                   = linechar^0 * newline
-                               + linechar^1 * eof
-  local nonemptyline           = line - blankline
-
-  local chunk = line * (optionallyindentedline - blankline)^0
-
-  -- block followed by 0 or more optionally
-  -- indented blocks with first line indented.
-  local function indented_blocks(bl)
-    return Cs( bl
-             * (blankline^1 * indent * -blankline * bl)^0
-             * (blankline^1 + eof) )
-  end
-%    \end{macrocode}
 % \paragraph{List \acro{peg} Patterns}
 %  \begin{macrocode}
   local bulletchar = C(plus + asterisk + dash)
@@ -2803,14 +2831,13 @@
 
   local NoteRef    = RawNoteRef / lookup_note
 
-  local NoteBlock
 
-  if options.footnotes then
-    NoteBlock = leader * RawNoteRef * colon * spnl *
-                indented_blocks(chunk) / register_note
-  else
-    NoteBlock = fail
-  end
+  local NoteBlock = leader * RawNoteRef * colon * spnl
+                  * indented_blocks(chunk) / register_note
+
+  local InlineNote = circumflex -- no notes inside notes
+                   * (tag / parse_inlines_no_inline_note)
+                   / writer.note
 %    \end{macrocode}
 % \paragraph{Link and Image \acro{peg} Patterns}
 %  \begin{macrocode}
@@ -3295,6 +3322,7 @@
                             + V("UlOrStarLine")
                             + V("Strong")
                             + V("Emph")
+                            + V("InlineNote")
                             + V("NoteRef")
                             + V("Citations")
                             + V("Link")
@@ -3312,6 +3340,7 @@
       UlOrStarLine          = UlOrStarLine,
       Strong                = Strong,
       Emph                  = Emph,
+      InlineNote            = InlineNote,
       NoteRef               = NoteRef,
       Citations             = Citations,
       Link                  = Link,
@@ -3342,6 +3371,10 @@
     syntax.NoteRef = fail
   end
 
+  if not options.inlineFootnotes then
+    syntax.InlineNote = fail
+  end
+
   if not options.smartEllipses then
     syntax.Smart = fail
   end
@@ -3361,6 +3394,10 @@
   inlines_no_link_t.Link = fail
   inlines_no_link = Ct(inlines_no_link_t)
 
+  local inlines_no_inline_note_t = util.table_copy(inlines_t)
+  inlines_no_inline_note_t.InlineNote = fail
+  inlines_no_inline_note = Ct(inlines_no_inline_note_t)
+
   local inlines_nbsp_t = util.table_copy(inlines_t)
   inlines_nbsp_t.Endline = NonbreakingEndline
   inlines_nbsp_t.Space = NonbreakingSpace
@@ -3539,6 +3576,9 @@
 \ifx\markdownOptionHybrid\undefined\else
   hybrid = \markdownOptionHybrid,
 \fi
+\ifx\markdownOptionInlineFootnotes\undefined\else
+  inlineFootnotes = \markdownOptionInlineFootnotes,
+\fi
 \ifx\markdownOptionPreserveTabs\undefined\else
   preserveTabs = \markdownOptionPreserveTabs,
 \fi

Modified: trunk/Master/texmf-dist/tex/generic/markdown/markdown.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/markdown/markdown.tex	2016-12-08 01:02:34 UTC (rev 42651)
+++ trunk/Master/texmf-dist/tex/generic/markdown/markdown.tex	2016-12-08 23:00:36 UTC (rev 42652)
@@ -45,8 +45,8 @@
 %% 
 %% The names of the source files used are shown above.
 %% 
-\def\markdownLastModified{2016/09/15}%
-\def\markdownVersion{2.1.3}%
+\def\markdownLastModified{2016/12/07}%
+\def\markdownVersion{2.2.1}%
 \let\markdownBegin\relax
 \let\markdownEnd\relax
 \let\markdownInput\relax
@@ -64,6 +64,7 @@
 \let\markdownOptionFencedCode\undefined
 \let\markdownOptionHashEnumerators\undefined
 \let\markdownOptionHybrid\undefined
+\let\markdownOptionInlineFootnotes\undefined
 \let\markdownOptionPreserveTabs\undefined
 \let\markdownOptionSmartEllipses\undefined
 \let\markdownOptionStartNumber\undefined
@@ -354,6 +355,9 @@
 \ifx\markdownOptionHybrid\undefined\else
   hybrid = \markdownOptionHybrid,
 \fi
+\ifx\markdownOptionInlineFootnotes\undefined\else
+  inlineFootnotes = \markdownOptionInlineFootnotes,
+\fi
 \ifx\markdownOptionPreserveTabs\undefined\else
   preserveTabs = \markdownOptionPreserveTabs,
 \fi

Modified: trunk/Master/texmf-dist/tex/latex/markdown/markdown.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/markdown/markdown.sty	2016-12-08 01:02:34 UTC (rev 42651)
+++ trunk/Master/texmf-dist/tex/latex/markdown/markdown.sty	2016-12-08 23:00:36 UTC (rev 42652)
@@ -79,6 +79,8 @@
   \def\markdownOptionHashEnumerators{#1}}%
 \define at key{markdownOptions}{hybrid}[true]{%
   \def\markdownOptionHybrid{#1}}%
+\define at key{markdownOptions}{inlineFotnotes}[true]{%
+  \def\markdownOptionInlineFootnotes{#1}}%
 \define at key{markdownOptions}{preserveTabs}[true]{%
   \def\markdownOptionPreserveTabs{#1}}%
 \define at key{markdownOptions}{smartEllipses}[true]{%

Modified: trunk/Master/texmf-dist/tex/luatex/markdown/markdown.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/markdown/markdown.lua	2016-12-08 01:02:34 UTC (rev 42651)
+++ trunk/Master/texmf-dist/tex/luatex/markdown/markdown.lua	2016-12-08 23:00:36 UTC (rev 42652)
@@ -58,7 +58,7 @@
 -- those in the standard .ins files.
 -- 
 local metadata = {
-    version   = "2.1.3",
+    version   = "2.2.1",
     comment   = "A module for the conversion from markdown to plain TeX",
     author    = "John MacFarlane, Hans Hagen, Vít Novotný",
     copyright = "2009-2016 John MacFarlane, Hans Hagen; 2016 Vít Novotný",
@@ -82,6 +82,7 @@
 defaultOptions.hybrid = false
 defaultOptions.fencedCode = false
 defaultOptions.footnotes = false
+defaultOptions.inlineFootnotes = false
 defaultOptions.preserveTabs = false
 defaultOptions.smartEllipses = false
 defaultOptions.startNumber = true
@@ -409,6 +410,92 @@
 
   return self
 end
+local percent                = P("%")
+local at                     = P("@")
+local comma                  = P(",")
+local asterisk               = P("*")
+local dash                   = P("-")
+local plus                   = P("+")
+local underscore             = P("_")
+local period                 = P(".")
+local hash                   = P("#")
+local ampersand              = P("&")
+local backtick               = P("`")
+local less                   = P("<")
+local more                   = P(">")
+local space                  = P(" ")
+local squote                 = P("'")
+local dquote                 = P('"')
+local lparent                = P("(")
+local rparent                = P(")")
+local lbracket               = P("[")
+local rbracket               = P("]")
+local circumflex             = P("^")
+local slash                  = P("/")
+local equal                  = P("=")
+local colon                  = P(":")
+local semicolon              = P(";")
+local exclamation            = P("!")
+local tilde                  = P("~")
+
+local digit                  = R("09")
+local hexdigit               = R("09","af","AF")
+local letter                 = R("AZ","az")
+local alphanumeric           = R("AZ","az","09")
+local keyword                = letter * alphanumeric^0
+local internal_punctuation   = S(":;,.#$%&-+?<>~/")
+
+local doubleasterisks        = P("**")
+local doubleunderscores      = P("__")
+local fourspaces             = P("    ")
+
+local any                    = P(1)
+local fail                   = any - 1
+local always                 = P("")
+
+local escapable              = S("\\`*_{}[]()+_.!<>#-~:^@;")
+
+local anyescaped             = P("\\") / "" * escapable
+                             + any
+
+local tab                    = P("\t")
+local spacechar              = S("\t ")
+local spacing                = S(" \n\r\t")
+local newline                = P("\n")
+local nonspacechar           = any - spacing
+local tightblocksep          = P("\001")
+
+local specialchar            = S("*_`&[]<!\\. at -^")
+
+local normalchar             = any -
+                               (specialchar + spacing + tightblocksep)
+local optionalspace          = spacechar^0
+local eof                    = - any
+local nonindentspace         = space^-3 * - spacechar
+local indent                 = space^-3 * tab
+                             + fourspaces / ""
+local linechar               = P(1 - newline)
+
+local blankline              = optionalspace * newline / "\n"
+local blanklines             = blankline^0
+local skipblanklines         = (optionalspace * newline)^0
+local indentedline           = indent    /"" * C(linechar^1 * newline^-1)
+local optionallyindentedline = indent^-1 /"" * C(linechar^1 * newline^-1)
+local sp                     = spacing^0
+local spnl                   = optionalspace * (newline * optionalspace)^-1
+local line                   = linechar^0 * newline
+                             + linechar^1 * eof
+local nonemptyline           = line - blankline
+
+local chunk = line * (optionallyindentedline - blankline)^0
+
+-- block followed by 0 or more optionally
+-- indented blocks with first line indented.
+local function indented_blocks(bl)
+  return Cs( bl
+           * (blankline^1 * indent * -blankline * bl)^0
+           * (blankline^1 + eof) )
+end
 M.reader = {}
 function M.reader.new(writer, options)
   local self = {}
@@ -434,7 +521,10 @@
   local syntax
   local blocks_toplevel
   local blocks
-  local inlines, inlines_no_link, inlines_nbsp
+  local inlines
+  local inlines_no_link
+  local inlines_no_inline_note
+  local inlines_nbsp
 
   local function create_parser(name, grammar)
     return function(str)
@@ -455,94 +545,11 @@
     function() return inlines end)
   local parse_inlines_no_link = create_parser("parse_inlines_no_link",
     function() return inlines_no_link end)
+  local parse_inlines_no_inline_note = create_parser(
+    "parse_inlines_no_inline_note",
+    function() return inlines_no_inline_note end)
   local parse_inlines_nbsp = create_parser("parse_inlines_nbsp",
     function() return inlines_nbsp end)
-  local percent                = P("%")
-  local at                     = P("@")
-  local comma                  = P(",")
-  local asterisk               = P("*")
-  local dash                   = P("-")
-  local plus                   = P("+")
-  local underscore             = P("_")
-  local period                 = P(".")
-  local hash                   = P("#")
-  local ampersand              = P("&")
-  local backtick               = P("`")
-  local less                   = P("<")
-  local more                   = P(">")
-  local space                  = P(" ")
-  local squote                 = P("'")
-  local dquote                 = P('"')
-  local lparent                = P("(")
-  local rparent                = P(")")
-  local lbracket               = P("[")
-  local rbracket               = P("]")
-  local circumflex             = P("^")
-  local slash                  = P("/")
-  local equal                  = P("=")
-  local colon                  = P(":")
-  local semicolon              = P(";")
-  local exclamation            = P("!")
-  local tilde                  = P("~")
-
-  local digit                  = R("09")
-  local hexdigit               = R("09","af","AF")
-  local letter                 = R("AZ","az")
-  local alphanumeric           = R("AZ","az","09")
-  local keyword                = letter * alphanumeric^0
-  local internal_punctuation   = S(":;,.#$%&-+?<>~/")
-
-  local doubleasterisks        = P("**")
-  local doubleunderscores      = P("__")
-  local fourspaces             = P("    ")
-
-  local any                    = P(1)
-  local fail                   = any - 1
-  local always                 = P("")
-
-  local escapable              = S("\\`*_{}[]()+_.!<>#-~:^@;")
-
-  local anyescaped             = P("\\") / "" * escapable
-                               + any
-
-  local tab                    = P("\t")
-  local spacechar              = S("\t ")
-  local spacing                = S(" \n\r\t")
-  local newline                = P("\n")
-  local nonspacechar           = any - spacing
-  local tightblocksep          = P("\001")
-
-  local specialchar            = S("*_`&[]<!\\. at -")
-
-  local normalchar             = any -
-                                 (specialchar + spacing + tightblocksep)
-  local optionalspace          = spacechar^0
-  local eof                    = - any
-  local nonindentspace         = space^-3 * - spacechar
-  local indent                 = space^-3 * tab
-                               + fourspaces / ""
-  local linechar               = P(1 - newline)
-
-  local blankline              = optionalspace * newline / "\n"
-  local blanklines             = blankline^0
-  local skipblanklines         = (optionalspace * newline)^0
-  local indentedline           = indent    /"" * C(linechar^1 * newline^-1)
-  local optionallyindentedline = indent^-1 /"" * C(linechar^1 * newline^-1)
-  local sp                     = spacing^0
-  local spnl                   = optionalspace * (newline * optionalspace)^-1
-  local line                   = linechar^0 * newline
-                               + linechar^1 * eof
-  local nonemptyline           = line - blankline
-
-  local chunk = line * (optionallyindentedline - blankline)^0
-
-  -- block followed by 0 or more optionally
-  -- indented blocks with first line indented.
-  local function indented_blocks(bl)
-    return Cs( bl
-             * (blankline^1 * indent * -blankline * bl)^0
-             * (blankline^1 + eof) )
-  end
   local bulletchar = C(plus + asterisk + dash)
 
   local bullet     = ( Cg(bulletchar, "bulletchar") * #spacing * (tab + space^-3)
@@ -725,14 +732,12 @@
 
   local NoteRef    = RawNoteRef / lookup_note
 
-  local NoteBlock
+  local NoteBlock = leader * RawNoteRef * colon * spnl
+                  * indented_blocks(chunk) / register_note
 
-  if options.footnotes then
-    NoteBlock = leader * RawNoteRef * colon * spnl *
-                indented_blocks(chunk) / register_note
-  else
-    NoteBlock = fail
-  end
+  local InlineNote = circumflex -- no notes inside notes
+                   * (tag / parse_inlines_no_inline_note)
+                   / writer.note
   -- List of references defined in the document
   local references
 
@@ -1160,6 +1165,7 @@
                             + V("UlOrStarLine")
                             + V("Strong")
                             + V("Emph")
+                            + V("InlineNote")
                             + V("NoteRef")
                             + V("Citations")
                             + V("Link")
@@ -1177,6 +1183,7 @@
       UlOrStarLine          = UlOrStarLine,
       Strong                = Strong,
       Emph                  = Emph,
+      InlineNote            = InlineNote,
       NoteRef               = NoteRef,
       Citations             = Citations,
       Link                  = Link,
@@ -1207,6 +1214,10 @@
     syntax.NoteRef = fail
   end
 
+  if not options.inlineFootnotes then
+    syntax.InlineNote = fail
+  end
+
   if not options.smartEllipses then
     syntax.Smart = fail
   end
@@ -1226,6 +1237,10 @@
   inlines_no_link_t.Link = fail
   inlines_no_link = Ct(inlines_no_link_t)
 
+  local inlines_no_inline_note_t = util.table_copy(inlines_t)
+  inlines_no_inline_note_t.InlineNote = fail
+  inlines_no_inline_note = Ct(inlines_no_inline_note_t)
+
   local inlines_nbsp_t = util.table_copy(inlines_t)
   inlines_nbsp_t.Endline = NonbreakingEndline
   inlines_nbsp_t.Space = NonbreakingSpace



More information about the tex-live-commits mailing list