summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-04-10 21:55:22 +0000
committerKarl Berry <karl@freefriends.org>2017-04-10 21:55:22 +0000
commitc8cd8edf4451d006d810c0a699f9c6f746d06b66 (patch)
treed7b47f7b08d98c6fc1d1ca12902e11f667ca7892 /Master/texmf-dist/tex/luatex
parent600c810944f8cd838687db76c11733a83e903a86 (diff)
markdown (10apr17)
git-svn-id: svn://tug.org/texlive/trunk@43737 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex')
-rw-r--r--Master/texmf-dist/tex/luatex/markdown/markdown.lua70
1 files changed, 43 insertions, 27 deletions
diff --git a/Master/texmf-dist/tex/luatex/markdown/markdown.lua b/Master/texmf-dist/tex/luatex/markdown/markdown.lua
index de9895c8c27..39668713584 100644
--- a/Master/texmf-dist/tex/luatex/markdown/markdown.lua
+++ b/Master/texmf-dist/tex/luatex/markdown/markdown.lua
@@ -58,7 +58,7 @@
-- those in the standard .ins files.
--
local metadata = {
- version = "2.4.0",
+ version = "2.5.0",
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; " ..
@@ -79,19 +79,21 @@ defaultOptions.breakableBlockquotes = false
defaultOptions.cacheDir = "."
defaultOptions.citationNbsps = true
defaultOptions.citations = false
+defaultOptions.codeSpans = true
defaultOptions.contentBlocks = false
defaultOptions.contentBlocksLanguageMap = "markdown-languages.json"
defaultOptions.definitionLists = false
+defaultOptions.fencedCode = false
+defaultOptions.footnotes = false
defaultOptions.hashEnumerators = false
defaultOptions.html = false
defaultOptions.hybrid = false
-defaultOptions.fencedCode = false
-defaultOptions.footnotes = false
defaultOptions.inlineFootnotes = false
defaultOptions.preserveTabs = false
defaultOptions.smartEllipses = false
defaultOptions.startNumber = true
defaultOptions.tightLists = true
+defaultOptions.underscores = true
local upper, gsub, format, length =
string.upper, string.gsub, string.format, string.len
local concat = table.concat
@@ -1495,17 +1497,27 @@ function M.reader.new(writer, options)
+ parsers.spacechar^1 * larsers.Endline^-1
* parsers.optionalspace / writer.nbsp
- larsers.Strong = ( parsers.between(parsers.Inline, parsers.doubleasterisks,
- parsers.doubleasterisks)
- + parsers.between(parsers.Inline, parsers.doubleunderscores,
- parsers.doubleunderscores)
- ) / writer.strong
+ if options.underscores then
+ larsers.Strong = ( parsers.between(parsers.Inline, parsers.doubleasterisks,
+ parsers.doubleasterisks)
+ + parsers.between(parsers.Inline, parsers.doubleunderscores,
+ parsers.doubleunderscores)
+ ) / writer.strong
+
+ larsers.Emph = ( parsers.between(parsers.Inline, parsers.asterisk,
+ parsers.asterisk)
+ + parsers.between(parsers.Inline, parsers.underscore,
+ parsers.underscore)
+ ) / writer.emphasis
+ else
+ larsers.Strong = ( parsers.between(parsers.Inline, parsers.doubleasterisks,
+ parsers.doubleasterisks)
+ ) / writer.strong
- larsers.Emph = ( parsers.between(parsers.Inline, parsers.asterisk,
- parsers.asterisk)
- + parsers.between(parsers.Inline, parsers.underscore,
- parsers.underscore)
- ) / writer.emphasis
+ larsers.Emph = ( parsers.between(parsers.Inline, parsers.asterisk,
+ parsers.asterisk)
+ ) / writer.emphasis
+ end
larsers.AutoLinkUrl = parsers.less
* C(parsers.alphanumeric^1 * P("://") * parsers.urlchar^1)
@@ -1806,14 +1818,6 @@ function M.reader.new(writer, options)
Symbol = larsers.Symbol,
}
- if not options.definitionLists then
- syntax.DefinitionList = parsers.fail
- end
-
- if not options.fencedCode then
- syntax.FencedCode = parsers.fail
- end
-
if not options.citations then
syntax.Citations = parsers.fail
end
@@ -1822,16 +1826,20 @@ function M.reader.new(writer, options)
syntax.ContentBlock = parsers.fail
end
- if not options.footnotes then
- syntax.NoteRef = parsers.fail
+ if not options.codeSpans then
+ syntax.Code = parsers.fail
end
- if not options.inlineFootnotes then
- syntax.InlineNote = parsers.fail
+ if not options.definitionLists then
+ syntax.DefinitionList = parsers.fail
end
- if not options.smartEllipses then
- syntax.Smart = parsers.fail
+ if not options.fencedCode then
+ syntax.FencedCode = parsers.fail
+ end
+
+ if not options.footnotes then
+ syntax.NoteRef = parsers.fail
end
if not options.html then
@@ -1840,6 +1848,14 @@ function M.reader.new(writer, options)
syntax.HtmlEntity = parsers.fail
end
+ if not options.inlineFootnotes then
+ syntax.InlineNote = parsers.fail
+ end
+
+ if not options.smartEllipses then
+ syntax.Smart = parsers.fail
+ end
+
local blocks_toplevel_t = util.table_copy(syntax)
blocks_toplevel_t.Paragraph = larsers.ToplevelParagraph
larsers.blocks_toplevel = Ct(blocks_toplevel_t)