Skip to content

Commit 47ea5cd

Browse files
authored
Merge branch 'pandoc:master' into master
2 parents 3371914 + ffcd913 commit 47ea5cd

File tree

19 files changed

+1097
-34
lines changed

19 files changed

+1097
-34
lines changed

.github/CODEOWNERS

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Default
2+
* @tarleb @jgm
3+
4+
include-files/* @tarleb
5+
revealjs-codeblock/*
6+
latex-hyphen/* @frederik-elwert
7+
lilypond/* @cole-miller
8+
scholarly-metadata/* @tarleb
9+
list-table/*
10+
scrlttr2/* @tarleb
11+
abstract-to-meta/* @tarleb
12+
lua-debug-example/*
13+
section-refs/*
14+
author-info-blocks/* @tarleb
15+
math2svg/*
16+
short-captions/*
17+
bibexport/* @tarleb
18+
mhchem/* @jgm
19+
spellcheck/*
20+
cito/* @tarleb
21+
minted/*
22+
table-short-captions/*
23+
diagram-generator/*
24+
multiple-bibliographies/* @tarleb
25+
track-changes/* @tolot27
26+
doi2cite/*
27+
not-in-format/*
28+
wordcount/* @jgm
29+
first-line-indent/*
30+
pagebreak/* @tarleb
31+
include-code-files/*
32+
pandoc-quotes.lua/* @odkr

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
- CONTRIBUTING.md
1010
- LICENSE
1111
- .editorconfig
12+
- '.github/CODEOWNERS'
1213
push:
1314
branches:
1415
- master
@@ -17,6 +18,7 @@ on:
1718
- CONTRIBUTING.md
1819
- LICENSE
1920
- .editorconfig
21+
- '.github/CODEOWNERS'
2022
schedule:
2123
# At 4:17am each Monday
2224
- cron: '17 4 * * 1'

bibexport/bibexport.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ local List = require 'pandoc.List'
33

44
local citation_id_set = {}
55

6+
local type = utils.type or type
7+
68
-- Collect all citation IDs.
79
function Cite (c)
810
local cs = c.citations
@@ -37,7 +39,7 @@ function bibdata (bibliography)
3739
or stringifyMetaInlines(bibitem):gsub('%.bib$', '')
3840
end
3941

40-
local bibs = bibliography.t == 'MetaList'
42+
local bibs = (type(bibliography) == 'List' or bibliography.t == 'MetaList')
4143
and List.map(bibliography, bibname)
4244
or {bibname(bibliography)}
4345
return table.concat(bibs, ',')
@@ -62,7 +64,7 @@ function write_dummy_aux (bibliography, auxfile)
6264
local filename
6365
if type(auxfile) == 'string' then
6466
filename = auxfile
65-
elseif type(auxfile) == 'table' then
67+
elseif type(auxfile) == 'table' or type(auxfile) == 'Inlines' then
6668
-- assume list of inlines
6769
filename = utils.stringify(pandoc.Span(auxfile))
6870
else

first-line-indent/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ PANDOC ?= pandoc
55

66
test: test_latex test_html
77

8-
test_html: sample.md expected.html first-line-indent.lua
8+
test_html: sample.md first-line-indent.lua
99
@$(PANDOC) -s --lua-filter first-line-indent.lua --to=html $< \
1010
| $(DIFF) expected.html -
1111

12-
test_latex: sample.md expected.tex first-line-indent.lua
12+
test_latex: sample.md first-line-indent.lua
1313
@$(PANDOC) -s --lua-filter first-line-indent.lua --to=latex $< \
1414
| $(DIFF) expected.tex -
1515

first-line-indent/first-line-indent.lua

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,17 @@ local header_code = {
7575
]],
7676
}
7777

78+
--- Returns the type of a metadata value.
79+
--
80+
-- @param v a metadata value
81+
-- @return string one of Blocks, Inlines, List, table, string, or boolean.
82+
local type = PANDOC_VERSION > '2.16.2'
83+
and utils.type
84+
or function (v)
85+
local metatag = type(v) == 'table' and v.t and v.t:gsub('^Meta', '')
86+
return metatag and metatag ~= 'Map' and metatag or type(v)
87+
end
88+
7889
--- Add a block to the document's header-includes meta-data field.
7990
-- @param meta the document's metadata block
8091
-- @param blocks list of Pandoc block elements (e.g. RawBlock or Para)
@@ -87,7 +98,7 @@ local function add_header_includes(meta, blocks)
8798
-- add any exisiting meta['header-includes']
8899
-- it could be a MetaList or a single String
89100
if meta['header-includes'] then
90-
if meta['header-includes'].t == 'MetaList' then
101+
if type(meta['header-includes']) == 'List' then
91102
header_includes:extend(meta['header-includes'])
92103
else
93104
header_includes:insert(meta['header-includes'])
@@ -132,10 +143,10 @@ function process_metadata(meta)
132143

133144
if (user_options['remove-after']) then
134145

135-
if user_options['remove-after'].t == 'MetaInlines' or
136-
user_options['remove-after'].t == 'MetaList' then
146+
if type(user_options['remove-after']) == 'Inlines' or
147+
type(user_options['remove-after']) == 'List' then
137148

138-
if user_options['remove-after'].t == 'MetaInlines' then
149+
if type(user_options['remove-after']) == 'Inlines' then
139150

140151
options.remove_indent_after:insert (
141152
utils.stringify(user_options['remove-after']))
@@ -155,13 +166,13 @@ function process_metadata(meta)
155166

156167
if (user_options['dont-remove-after']) then
157168

158-
if user_options['dont-remove-after'].t == 'MetaInlines' or
159-
user_options['dont-remove-after'].t == 'MetaList' then
169+
if type(user_options['dont-remove-after']) == 'Inlines' or
170+
type(user_options['dont-remove-after']) == 'List' then
160171

161172
-- list of strings to be removed
162173
local blacklist = pandoc.List({})
163174

164-
if user_options['dont-remove-after'].t == 'MetaInlines' then
175+
if type(user_options['dont-remove-after']) == 'Inlines' then
165176

166177
blacklist:insert (
167178
utils.stringify(user_options['dont-remove-after']))

include-files/include-files.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,12 @@ function transclude (cb)
8787
if not fh then
8888
io.stderr:write("Cannot open file " .. line .. " | Skipping includes\n")
8989
else
90-
local contents = pandoc.read(fh:read '*a', format).blocks
90+
-- read file as the given format with global reader options
91+
local contents = pandoc.read(
92+
fh:read '*a',
93+
format,
94+
PANDOC_READER_OPTIONS
95+
).blocks
9196
last_heading_level = 0
9297
-- recursive transclusion
9398
contents = system.with_working_directory(

list-table/Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
DIFF ?= diff --strip-trailing-cr -u
2+
PANDOC ?= pandoc
3+
CMD = $(PANDOC) --lua-filter list-table.lua --to=html sample.md
4+
5+
test:
6+
@$(CMD) | $(DIFF) expected.html -
7+
8+
update:
9+
$(CMD) > expected.html
10+
11+
.PHONY: test update

0 commit comments

Comments
 (0)