Merge branch 'master' of github.com:jgm/pandoc

This commit is contained in:
John MacFarlane 2017-12-21 21:45:35 -08:00
commit 32f9dbbae5
2 changed files with 100 additions and 278 deletions

View file

@ -316,6 +316,9 @@ tableItemToJATS :: PandocMonad m
-> Bool
-> [Block]
-> JATS m Doc
tableItemToJATS opts isHeader [Plain item] =
inTags True (if isHeader then "th" else "td") [] <$>
inlinesToJATS opts item
tableItemToJATS opts isHeader item =
(inTags True (if isHeader then "th" else "td") [] . vcat) <$>
mapM (blockToJATS opts) item
@ -405,8 +408,11 @@ inlineToJATS opts (Link (ident,_,kvs) txt ('#':src, _)) = do
[("alt", stringify txt) | not (null txt)] ++
[("rid", src)] ++
[(k,v) | (k,v) <- kvs, k `elem` ["ref-type", "specific-use"]]
contents <- inlinesToJATS opts txt
return $ inTags False "xref" attr contents
if null txt
then return $ selfClosingTag "xref" attr
else do
contents <- inlinesToJATS opts txt
return $ inTags False "xref" attr contents
inlineToJATS opts (Link (ident,_,kvs) txt (src, tit)) = do
let attr = [("id", ident) | not (null ident)] ++
[("ext-link-type", "uri"),

View file

@ -15,92 +15,60 @@
<thead>
<tr>
<th>
<p>
Right
</p>
Right
</th>
<th>
<p>
Left
</p>
Left
</th>
<th>
<p>
Center
</p>
Center
</th>
<th>
<p>
Default
</p>
Default
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p>
12
</p>
12
</td>
<td>
<p>
12
</p>
12
</td>
<td>
<p>
12
</p>
12
</td>
<td>
<p>
12
</p>
12
</td>
</tr>
<tr>
<td>
<p>
123
</p>
123
</td>
<td>
<p>
123
</p>
123
</td>
<td>
<p>
123
</p>
123
</td>
<td>
<p>
123
</p>
123
</td>
</tr>
<tr>
<td>
<p>
1
</p>
1
</td>
<td>
<p>
1
</p>
1
</td>
<td>
<p>
1
</p>
1
</td>
<td>
<p>
1
</p>
1
</td>
</tr>
</tbody>
@ -117,92 +85,60 @@
<thead>
<tr>
<th>
<p>
Right
</p>
Right
</th>
<th>
<p>
Left
</p>
Left
</th>
<th>
<p>
Center
</p>
Center
</th>
<th>
<p>
Default
</p>
Default
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p>
12
</p>
12
</td>
<td>
<p>
12
</p>
12
</td>
<td>
<p>
12
</p>
12
</td>
<td>
<p>
12
</p>
12
</td>
</tr>
<tr>
<td>
<p>
123
</p>
123
</td>
<td>
<p>
123
</p>
123
</td>
<td>
<p>
123
</p>
123
</td>
<td>
<p>
123
</p>
123
</td>
</tr>
<tr>
<td>
<p>
1
</p>
1
</td>
<td>
<p>
1
</p>
1
</td>
<td>
<p>
1
</p>
1
</td>
<td>
<p>
1
</p>
1
</td>
</tr>
</tbody>
@ -224,92 +160,60 @@
<thead>
<tr>
<th>
<p>
Right
</p>
Right
</th>
<th>
<p>
Left
</p>
Left
</th>
<th>
<p>
Center
</p>
Center
</th>
<th>
<p>
Default
</p>
Default
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p>
12
</p>
12
</td>
<td>
<p>
12
</p>
12
</td>
<td>
<p>
12
</p>
12
</td>
<td>
<p>
12
</p>
12
</td>
</tr>
<tr>
<td>
<p>
123
</p>
123
</td>
<td>
<p>
123
</p>
123
</td>
<td>
<p>
123
</p>
123
</td>
<td>
<p>
123
</p>
123
</td>
</tr>
<tr>
<td>
<p>
1
</p>
1
</td>
<td>
<p>
1
</p>
1
</td>
<td>
<p>
1
</p>
1
</td>
<td>
<p>
1
</p>
1
</td>
</tr>
</tbody>
@ -332,70 +236,46 @@
<thead>
<tr>
<th>
<p>
Centered Header
</p>
Centered Header
</th>
<th>
<p>
Left Aligned
</p>
Left Aligned
</th>
<th>
<p>
Right Aligned
</p>
Right Aligned
</th>
<th>
<p>
Default aligned
</p>
Default aligned
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p>
First
</p>
First
</td>
<td>
<p>
row
</p>
row
</td>
<td>
<p>
12.0
</p>
12.0
</td>
<td>
<p>
Example of a row that spans multiple lines.
</p>
Example of a row that spans multiple lines.
</td>
</tr>
<tr>
<td>
<p>
Second
</p>
Second
</td>
<td>
<p>
row
</p>
row
</td>
<td>
<p>
5.0
</p>
5.0
</td>
<td>
<p>
Heres another one. Note the blank line between rows.
</p>
Heres another one. Note the blank line between rows.
</td>
</tr>
</tbody>
@ -412,70 +292,46 @@
<thead>
<tr>
<th>
<p>
Centered Header
</p>
Centered Header
</th>
<th>
<p>
Left Aligned
</p>
Left Aligned
</th>
<th>
<p>
Right Aligned
</p>
Right Aligned
</th>
<th>
<p>
Default aligned
</p>
Default aligned
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p>
First
</p>
First
</td>
<td>
<p>
row
</p>
row
</td>
<td>
<p>
12.0
</p>
12.0
</td>
<td>
<p>
Example of a row that spans multiple lines.
</p>
Example of a row that spans multiple lines.
</td>
</tr>
<tr>
<td>
<p>
Second
</p>
Second
</td>
<td>
<p>
row
</p>
row
</td>
<td>
<p>
5.0
</p>
5.0
</td>
<td>
<p>
Heres another one. Note the blank line between rows.
</p>
Heres another one. Note the blank line between rows.
</td>
</tr>
</tbody>
@ -491,68 +347,44 @@
<tbody>
<tr>
<td>
<p>
12
</p>
12
</td>
<td>
<p>
12
</p>
12
</td>
<td>
<p>
12
</p>
12
</td>
<td>
<p>
12
</p>
12
</td>
</tr>
<tr>
<td>
<p>
123
</p>
123
</td>
<td>
<p>
123
</p>
123
</td>
<td>
<p>
123
</p>
123
</td>
<td>
<p>
123
</p>
123
</td>
</tr>
<tr>
<td>
<p>
1
</p>
1
</td>
<td>
<p>
1
</p>
1
</td>
<td>
<p>
1
</p>
1
</td>
<td>
<p>
1
</p>
1
</td>
</tr>
</tbody>
@ -568,46 +400,30 @@
<tbody>
<tr>
<td>
<p>
First
</p>
First
</td>
<td>
<p>
row
</p>
row
</td>
<td>
<p>
12.0
</p>
12.0
</td>
<td>
<p>
Example of a row that spans multiple lines.
</p>
Example of a row that spans multiple lines.
</td>
</tr>
<tr>
<td>
<p>
Second
</p>
Second
</td>
<td>
<p>
row
</p>
row
</td>
<td>
<p>
5.0
</p>
5.0
</td>
<td>
<p>
Heres another one. Note the blank line between rows.
</p>
Heres another one. Note the blank line between rows.
</td>
</tr>
</tbody>