From 7d193b2aadfed75b4c85a97f24ba5b36a3961fa9 Mon Sep 17 00:00:00 2001 From: Nokome Bentley Date: Tue, 6 Mar 2018 06:44:34 +1300 Subject: Remove extraneous, significant whitespace in JATS writer output (#4335) This patch fixes some cases where the JATS writer was introducing semantically significant whitespace by indenting and wrapping tags. Note that the JATS spec has a content model for `

` tags of `(#PCDATA | ...`. Any tag where `#PCDATA` children are possible should not have any indentation. The same is true for ``, ``, ``, `

\n @&\n

" - , "lang" =: codeWith ("", ["c"], []) "@&" =?> "

\n @&\n

" + [ "basic" =: code "@&" =?> "

@&

" + , "lang" =: codeWith ("", ["c"], []) "@&" =?> "

@&

" ] , testGroup "block code" [ "basic" =: codeBlock "@&" =?> "@&" @@ -44,7 +44,7 @@ tests = [ testGroup "inline code" ] , testGroup "inlines" [ "Emphasis" =: emph "emphasized" - =?> "

\n emphasized\n

" + =?> "

emphasized

" ] , "bullet list" =: bulletList [ plain $ text "first" , plain $ text "second" @@ -52,19 +52,13 @@ tests = [ testGroup "inline code" ] =?> "\n\ \ \n\ - \

\n\ - \ first\n\ - \

\n\ + \

first

\n\ \
\n\ \ \n\ - \

\n\ - \ second\n\ - \

\n\ + \

second

\n\ \
\n\ \ \n\ - \

\n\ - \ third\n\ - \

\n\ + \

third

\n\ \
\n\ \
" , testGroup "definition lists" @@ -72,24 +66,18 @@ tests = [ testGroup "inline code" [plain (text "hi there")])] =?> "\n\ \ \n\ - \ \n\ - \ testing\n\ - \ \n\ + \ testing\n\ \ \n\ - \

\n\ - \ hi there\n\ - \

\n\ + \

hi there

\n\ \
\n\ \
\n\ \
" ] , testGroup "math" [ "escape |" =: para (math "\\sigma|_{\\{x\\}}") =?> - "

\n\ - \ \n\ - \ \n\ - \ σ|{x}\n\ - \

" + "

\n\ + \\n\ + \σ|{x}

" ] , testGroup "headers" [ "unnumbered header" =: @@ -97,9 +85,7 @@ tests = [ testGroup "inline code" (text "Header 1" <> note (plain $ text "note")) =?> "\n\ \ Header 1<fn>\n\ - \ <p>\n\ - \ note\n\ - \ </p>\n\ + \ <p>note</p>\n\ \ </fn>\n\ \" , "unnumbered sub header" =: diff --git a/test/jats-reader.native b/test/jats-reader.native index a7c349149..83feeeffd 100644 --- a/test/jats-reader.native +++ b/test/jats-reader.native @@ -1,5 +1,5 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Space,Str "MacFarlane"]]),("title",MetaInlines [Str "Pandoc",Space,Str "Test",Space,Str "Suite"])]}) -[Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "set",Space,Str "of",Space,Str "tests",Space,Str "for",Space,Str "pandoc.",Space,Str "Most",Space,Str "of",Space,Str "them",Space,Str "are",Space,Str "adapted",Space,Str "from",Space,Str "John",SoftBreak,Str "Gruber's",Space,Str "markdown",Space,Str "test",Space,Str "suite."] +[Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "set",Space,Str "of",Space,Str "tests",Space,Str "for",Space,Str "pandoc.",Space,Str "Most",Space,Str "of",Space,Str "them",Space,Str "are",Space,Str "adapted",Space,Str "from",Space,Str "John",Space,Str "Gruber's",Space,Str "markdown",Space,Str "test",Space,Str "suite."] ,Header 1 ("headers",[],[]) [Str "Headers"] ,Header 2 ("level-2-with-an-embedded-link",[],[]) [Str "Level",Space,Str "2",Space,Str "with",Space,Str "an",SoftBreak,Link ("",[],[]) [Str "embedded",SoftBreak,Str "link"] ("/url","")] ,Header 3 ("level-3-with-emphasis",[],[]) [Str "Level",Space,Str "3",Space,Str "with",Space,Emph [Str "emphasis"]] @@ -13,7 +13,7 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Spa ,Para [Str "with",Space,Str "no",Space,Str "blank",Space,Str "line"] ,Header 1 ("paragraphs",[],[]) [Str "Paragraphs"] ,Para [Str "Here's",Space,Str "a",Space,Str "regular",Space,Str "paragraph."] -,Para [Str "In",Space,Str "Markdown",Space,Str "1.0.0",Space,Str "and",Space,Str "earlier.",Space,Str "Version",Space,Str "8.",Space,Str "This",Space,Str "line",Space,Str "turns",Space,Str "into",Space,Str "a",SoftBreak,Str "list",Space,Str "item.",Space,Str "Because",Space,Str "a",Space,Str "hard-wrapped",Space,Str "line",Space,Str "in",Space,Str "the",Space,Str "middle",Space,Str "of",Space,Str "a",Space,Str "paragraph",SoftBreak,Str "looked",Space,Str "like",Space,Str "a",Space,Str "list",Space,Str "item."] +,Para [Str "In",Space,Str "Markdown",Space,Str "1.0.0",Space,Str "and",Space,Str "earlier.",Space,Str "Version",Space,Str "8.",Space,Str "This",Space,Str "line",Space,Str "turns",Space,Str "into",Space,Str "a",Space,Str "list",Space,Str "item.",Space,Str "Because",Space,Str "a",Space,Str "hard-wrapped",Space,Str "line",Space,Str "in",Space,Str "the",Space,Str "middle",Space,Str "of",Space,Str "a",Space,Str "paragraph",Space,Str "looked",Space,Str "like",Space,Str "a",Space,Str "list",Space,Str "item."] ,Para [Str "Here's",Space,Str "one",Space,Str "with",Space,Str "a",Space,Str "bullet.",Space,Str "*",Space,Str "criminey."] ,Para [Str "There",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "hard",Space,Str "line",Space,Str "break",LineBreak,Str "here."] ,Header 1 ("block-quotes",[],[]) [Str "Block",Space,Str "Quotes"] diff --git a/test/jats-reader.xml b/test/jats-reader.xml index f98caa46e..bfbfdc6a0 100644 --- a/test/jats-reader.xml +++ b/test/jats-reader.xml @@ -29,10 +29,7 @@ -

- This is a set of tests for pandoc. Most of them are adapted from John - Gruber's markdown test suite. -

+

This is a set of tests for pandoc. Most of them are adapted from John Gruber's markdown test suite.

Headers @@ -56,91 +53,53 @@ Level 2 with <italic>emphasis</italic> Level 3 -

- with no blank line -

+

with no blank line

Level 2 -

- with no blank line -

+

with no blank line

Paragraphs -

- Here's a regular paragraph. -

-

- In Markdown 1.0.0 and earlier. Version 8. This line turns into a - list item. Because a hard-wrapped line in the middle of a paragraph - looked like a list item. -

-

- Here's one with a bullet. * criminey. -

-

- There should be a hard line breakhere. -

+

Here's a regular paragraph.

+

In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. Because a hard-wrapped line in the middle of a paragraph looked like a list item.

+

Here's one with a bullet. * criminey.

+

There should be a hard line breakhere.

Block Quotes -

- E-mail style: -

+

E-mail style:

-

- This is a block quote. It is pretty short. -

+

This is a block quote. It is pretty short.

-

- Code in a block quote: -

+

Code in a block quote:

sub status { print "working"; } -

- A list: -

+

A list:

-

- item one -

+

item one

-

- item two -

+

item two

-

- Nested block quotes: -

+

Nested block quotes:

-

- nested -

+

nested

-

- nested -

+

nested

-

- This should not be a block quote: 2 > 1. -

-

- Box-style: -

+

This should not be a block quote: 2 > 1.

+

Box-style:

-

- Example: -

+

Example:

sub status { print "working"; } @@ -148,39 +107,25 @@ -

- do laundry -

+

do laundry

-

- take out the trash -

+

take out the trash

-

- Here's a nested one: -

+

Here's a nested one:

-

- Joe said: -

+

Joe said:

-

- Don't quote me. -

+

Don't quote me.

-

- And a following paragraph. -

+

And a following paragraph.

Code Blocks -

- Code: -

+

Code:

---- (should be four hyphens) sub status { @@ -188,9 +133,7 @@ sub status { } this code block is indented by one tab -

- And: -

+

And:

this code block is indented by two tabs These should not be escaped: \$ \\ \> \[ \{ @@ -199,236 +142,144 @@ These should not be escaped: \$ \\ \> \[ \{ Lists Unordered -

- Asterisks tight: -

+

Asterisks tight:

-

- asterisk 1 -

+

asterisk 1

-

- asterisk 2 -

+

asterisk 2

-

- asterisk 3 -

+

asterisk 3

-

- Asterisks loose: -

+

Asterisks loose:

-

- asterisk 1 -

+

asterisk 1

-

- asterisk 2 -

+

asterisk 2

-

- asterisk 3 -

+

asterisk 3

-

- Pluses tight: -

+

Pluses tight:

-

- Plus 1 -

+

Plus 1

-

- Plus 2 -

+

Plus 2

-

- Plus 3 -

+

Plus 3

-

- Pluses loose: -

+

Pluses loose:

-

- Plus 1 -

+

Plus 1

-

- Plus 2 -

+

Plus 2

-

- Plus 3 -

+

Plus 3

-

- Minuses tight: -

+

Minuses tight:

-

- Minus 1 -

+

Minus 1

-

- Minus 2 -

+

Minus 2

-

- Minus 3 -

+

Minus 3

-

- Minuses loose: -

+

Minuses loose:

-

- Minus 1 -

+

Minus 1

-

- Minus 2 -

+

Minus 2

-

- Minus 3 -

+

Minus 3

Ordered -

- Tight: -

+

Tight:

-

- First -

+

First

-

- Second -

+

Second

-

- Third -

+

Third

-

- and: -

+

and:

-

- One -

+

One

-

- Two -

+

Two

-

- Three -

+

Three

-

- Loose using tabs: -

+

Loose using tabs:

-

- First -

+

First

-

- Second -

+

Second

-

- Third -

+

Third

-

- and using spaces: -

+

and using spaces:

-

- One -

+

One

-

- Two -

+

Two

-

- Three -

+

Three

-

- Multiple paragraphs: -

+

Multiple paragraphs:

-

- Item 1, graf one. -

-

- Item 1. graf two. The quick brown fox jumped over the lazy - dog's back. -

+

Item 1, graf one.

+

Item 1. graf two. The quick brown fox jumped over the lazy + dog's back.

-

- Item 2. -

+

Item 2.

-

- Item 3. -

+

Item 3.

-

- List styles: -

+

List styles:

@@ -436,97 +287,63 @@ These should not be escaped: \$ \\ \> \[ \{ Nested -

- Tab -

+

Tab

-

- Tab -

+

Tab

-

- Tab -

+

Tab

-

- Here's another: -

+

Here's another:

-

- First -

+

First

-

- Second: -

+

Second:

-

- Fee -

+

Fee

-

- Fie -

+

Fie

-

- Foe -

+

Foe

-

- Third -

+

Third

-

- Same thing but with paragraphs: -

+

Same thing but with paragraphs:

-

- First -

+

First

-

- Second: -

+

Second:

-

- Fee -

+

Fee

-

- Fie -

+

Fie

-

- Foe -

+

Foe

-

- Third -

+

Third

@@ -534,24 +351,16 @@ These should not be escaped: \$ \\ \> \[ \{ Tabs and spaces -

- this is a list item indented with tabs -

+

this is a list item indented with tabs

-

- this is a list item indented with spaces -

+

this is a list item indented with spaces

-

- this is an example list item indented with tabs -

+

this is an example list item indented with tabs

-

- this is an example list item indented with spaces -

+

this is an example list item indented with spaces

@@ -559,24 +368,16 @@ These should not be escaped: \$ \\ \> \[ \{ Fancy list markers -

- Autonumbering: -

+

Autonumbering:

-

- Autonumber. -

+

Autonumber.

-

- More. -

+

More.

-

- Nested. -

+

Nested.

@@ -590,12 +391,8 @@ These should not be escaped: \$ \\ \> \[ \{ Violin -

- Stringed musical instrument. -

-

- Torture device. -

+

Stringed musical instrument.

+

Torture device.

@@ -603,9 +400,7 @@ These should not be escaped: \$ \\ \> \[ \{ CelloVioloncello -

- Low-voiced stringed instrument. -

+

Low-voiced stringed instrument.

@@ -613,452 +408,244 @@ These should not be escaped: \$ \\ \> \[ \{
Inline Markup -

- This is emphasized, and so is - this. -

-

- This is strong, and so - is this. -

-

- Empty and . -

-

- An +

This is emphasized, and so is + this.

+

This is strong, and so + is this.

+

Empty and .

+

An emphasized - link. -

-

- This is strong and em. -

-

- So is this word. -

-

- This is strong and em. -

-

- So is this word. -

-

- This is code: >, $, + link.

+

This is strong and em.

+

So is this word.

+

This is strong and em.

+

So is this word.

+

This is code: >, $, \, \$, - <html>. -

-

- This is small caps. -

-

- These are all underlined: foo and bar. -

-

- These are all strikethrough: foo, - bar, and baz. -

+ <html>.

+

This is small caps.

+

These are all underlined: foo and bar.

+

These are all strikethrough: foo, + bar, and baz.

Smart quotes, ellipses, dashes -

- "Hello," said the spider. "'Shelob' is my name." -

-

- 'A', 'B', and 'C' are letters. -

-

- 'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.' -

-

- 'He said, "I want to go."' Were you alive in the 70's? -

-

- Here is some quoted 'code' and a +

"Hello," said the spider. "'Shelob' is my name."

+

'A', 'B', and 'C' are letters.

+

'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'

+

'He said, "I want to go."' Were you alive in the 70's?

+

Here is some quoted 'code' and a "quoted - link". -

-

- Some dashes: one---two --- three--four -- five. -

-

- Dashes between numbers: 5-7, 255-66, 1987-1999. -

-

- Ellipses...and. . .and . . . . -

+ link".

+

Some dashes: one---two --- three--four -- five.

+

Dashes between numbers: 5-7, 255-66, 1987-1999.

+

Ellipses...and. . .and . . . .

LaTeX -

- \cite[22-23]{smith.1899} -

+

\cite[22-23]{smith.1899}

-

- \doublespacing -

+

\doublespacing

-

- $2+2=4$ -

+

$2+2=4$

-

- $x \in y$ -

+

$x \in y$

-

- $\alpha \wedge \omega$ -

+

$\alpha \wedge \omega$

-

- $223$ -

+

$223$

-

- $p$-Tree -

+

$p$-Tree

-

- $\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$ -

+

$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$

-

- Here's one that has a line break in it: $\alpha + \omega \times - x^2$. -

+

Here's one that has a line break in it: $\alpha + \omega \times + x^2$.

-

- These shouldn't be math: -

+

These shouldn't be math:

-

- To get the famous equation, write - $e = mc^2$. -

+

To get the famous equation, write + $e = mc^2$.

-

- $22,000 is a lot of money. So is $34,000. (It - worked if "lot" is emphasized.) -

+

$22,000 is a lot of money. So is $34,000. (It + worked if "lot" is emphasized.)

-

- Escaped $: $73 this should be - emphasized 23$. -

+

Escaped $: $73 this should be + emphasized 23$.

-

- Here's a LaTeX table: -

-

- \begin{tabular}{|l|l|}\hline Animal & Number \\ \hline Dog & - 2 \\ Cat & 1 \\ \hline \end{tabular} -

+

Here's a LaTeX table:

+

\begin{tabular}{|l|l|}\hline Animal & Number \\ \hline Dog & + 2 \\ Cat & 1 \\ \hline \end{tabular}

Special Characters -

- Here is some unicode: -

+

Here is some unicode:

-

- I hat: Î -

+

I hat: Î

-

- o umlaut: ö -

+

o umlaut: ö

-

- section: § -

+

section: §

-

- set membership: elem -

+

set membership: elem

-

- copyright: © -

+

copyright: ©

-

- AT&T has an ampersand in their name. -

-

- AT&T is another way to write it. -

-

- This & that. -

-

- 4 < 5. -

-

- 6 > 5. -

-

- Backslash: \ -

-

- Backtick: ` -

-

- Asterisk: * -

-

- Underscore: _ -

-

- Left brace: { -

-

- Right brace: } -

-

- Left bracket: [ -

-

- Right bracket: ] -

-

- Left paren: ( -

-

- Right paren: ) -

-

- Greater-than: > -

-

- Hash: # -

-

- Period: . -

-

- Bang: ! -

-

- Plus: + -

-

- Minus: - -

+

AT&T has an ampersand in their name.

+

AT&T is another way to write it.

+

This & that.

+

4 < 5.

+

6 > 5.

+

Backslash: \

+

Backtick: `

+

Asterisk: *

+

Underscore: _

+

Left brace: {

+

Right brace: }

+

Left bracket: [

+

Right bracket: ]

+

Left paren: (

+

Right paren: )

+

Greater-than: >

+

Hash: #

+

Period: .

+

Bang: !

+

Plus: +

+

Minus: -

Links Explicit -

- Just a - URL. -

-

- URL - and title. -

-

- URL - and title. -

-

- URL - and title. -

-

- URL - and title -

-

- URL - and title -

-

- Email link (nobody [at] nowhere.net) -

-

- Empty. -

+

Just a + URL.

+

URL + and title.

+

URL + and title.

+

URL + and title.

+

URL + and title

+

URL + and title

+

Email link (nobody [at] nowhere.net)

+

Empty.

Reference -

- Foo - bar. -

-

- Foo - bar. -

-

- Foo - bar. -

-

- With embedded - [brackets]. -

-

- b by - itself should be a link. -

-

- Indented - once. -

-

- Indented - twice. -

-

- Indented - thrice. -

-

- This should [not] be a link. -

+

Foo + bar.

+

Foo + bar.

+

Foo + bar.

+

With embedded + [brackets].

+

b by + itself should be a link.

+

Indented + once.

+

Indented + twice.

+

Indented + thrice.

+

This should [not] be a link.

[not]: /url -

- Foo - bar. -

-

- Foo - biz. -

+

Foo + bar.

+

Foo + biz.

With ampersands -

- Here's a +

Here's a link - with an ampersand in the URL. -

-

- Here's a link with an amersand in the link text: - AT&T. -

-

- Here's an + with an ampersand in the URL.

+

Here's a link with an amersand in the link text: + AT&T.

+

Here's an inline - link. -

-

- Here's an + link.

+

Here's an inline - link in pointy braces. -

+ link in pointy braces.

Autolinks -

- With an ampersand: - http://example.com/?foo=1&bar=2 -

+

With an ampersand: + http://example.com/?foo=1&bar=2

-

- In a list? -

+

In a list?

-

- http://example.com/ -

+

http://example.com/

-

- It should. -

+

It should.

-

- An e-mail address: nobody [at] nowhere.net -

+

An e-mail address: nobody [at] nowhere.net

-

- Blockquoted: - http://example.com/ -

+

Blockquoted: + http://example.com/

-

- Auto-links should not occur here: - <http://example.com/> -

+

Auto-links should not occur here: + <http://example.com/>

or here: <http://example.com/>
Images -

- From "Voyage dans la Lune" by Georges Melies (1902): -

-

- -

-

- Here is a movie +

From "Voyage dans la Lune" by Georges Melies (1902):

+

+

Here is a movie - icon. -

+ icon.

Footnotes -

- Here is a footnote reference(1), +

Here is a footnote reference(1), and another(longnote). This should not be a footnote reference, because it - contains a space^(my note). -

-

- (1) Here is the footnote. It can - go anywhere in the document, not just at the end. -

-

- (longnote) Here's - the other note. This one contains multiple blocks. -

-

- Caret characters are used to indicate that the blocks all belong to - a single footnote (as with block quotes). -

+ contains a space^(my note).

+

(1) Here is the footnote. It can + go anywhere in the document, not just at the end.

+

(longnote) Here's + the other note. This one contains multiple blocks.

+

Caret characters are used to indicate that the blocks all belong to + a single footnote (as with block quotes).

{ <code> } -

- If you want, you can use a caret at the beginning of every line, as +

If you want, you can use a caret at the beginning of every line, as with blockquotes, but all that you need is a caret at the beginning - of the first line of the block and any preceding blank lines. -

-

- text Leading space -

-

- Trailing space text -

-

- text Leading spaces -

-

- Trailing spaces text -

+ of the first line of the block and any preceding blank lines.

+

text Leading space

+

Trailing space text

+

text Leading spaces

+

Trailing spaces text

Tables @@ -1071,55 +658,37 @@ These should not be escaped: \$ \\ \> \[ \{ -

- X -

+

X

-

- Y -

+

Y

-

- Z -

+

Z

-

- 1 -

+

1

-

- 2 -

+

2

-

- 3 -

+

3

-

- 4 -

+

4

-

- 5 -

+

5

-

- 6 -

+

6

@@ -1131,55 +700,37 @@ These should not be escaped: \$ \\ \> \[ \{ -

- X -

+

X

-

- Y -

+

Y

-

- Z -

+

Z

-

- 1 -

+

1

-

- 2 -

+

2

-

- 3 -

+

3

-

- 4 -

+

4

-

- 5 -

+

5

-

- 6 -

+

6

@@ -1191,55 +742,37 @@ These should not be escaped: \$ \\ \> \[ \{ -

- X -

+

X

-

- Y -

+

Y

-

- Z -

+

Z

-

- 1 -

+

1

-

- 2 -

+

2

-

- 3 -

+

3

-

- 4 -

+

4

-

- 5 -

+

5

-

- 6 -

+

6

@@ -1251,55 +784,37 @@ These should not be escaped: \$ \\ \> \[ \{ -

- X -

+

X

-

- Y -

+

Y

-

- Z -

+

Z

-

- 1 -

+

1

-

- 2 -

+

2

-

- 3 -

+

3

-

- 4 -

+

4

-

- 5 -

+

5

-

- 6 -

+

6

@@ -1311,55 +826,37 @@ These should not be escaped: \$ \\ \> \[ \{ -

- X -

+

X

-

- Y -

+

Y

-

- Z -

+

Z

-

- 1 -

+

1

-

- 2 -

+

2

-

- 3 -

+

3

-

- 4 -

+

4

-

- 5 -

+

5

-

- 6 -

+

6

@@ -1371,55 +868,37 @@ These should not be escaped: \$ \\ \> \[ \{ -

- X -

+

X

-

- Y -

+

Y

-

- Z -

+

Z

-

- 1 -

+

1

-

- 2 -

+

2

-

- 3 -

+

3

-

- 4 -

+

4

-

- 5 -

+

5

-

- 6 -

+

6

@@ -1431,55 +910,37 @@ These should not be escaped: \$ \\ \> \[ \{ -

- X -

+

X

-

- Y -

+

Y

-

- Z -

+

Z

-

- 1 -

+

1

-

- 2 -

+

2

-

- 3 -

+

3

-

- 4 -

+

4

-

- 5 -

+

5

-

- 6 -

+

6

@@ -1491,55 +952,37 @@ These should not be escaped: \$ \\ \> \[ \{ -

- X -

+

X

-

- Y -

+

Y

-

- Z -

+

Z

-

- 1 -

+

1

-

- 2 -

+

2

-

- 3 -

+

3

-

- 4 -

+

4

-

- 5 -

+

5

-

- 6 -

+

6

@@ -1551,55 +994,37 @@ These should not be escaped: \$ \\ \> \[ \{ -

- X -

+

X

-

- Y -

+

Y

-

- Z -

+

Z

-

- 1 -

+

1

-

- 2 -

+

2

-

- 3 -

+

3

-

- 4 -

+

4

-

- 5 -

+

5

-

- 6 -

+

6

@@ -1614,36 +1039,24 @@ These should not be escaped: \$ \\ \> \[ \{ -

- 1 -

+

1

-

- 2 -

+

2

-

- 3 -

+

3

-

- 4 -

+

4

-

- 5 -

+

5

-

- 6 -

+

6

@@ -1655,36 +1068,24 @@ These should not be escaped: \$ \\ \> \[ \{ -

- 1 -

+

1

-

- 2 -

+

2

-

- 3 -

+

3

-

- 4 -

+

4

-

- 5 -

+

5

-

- 6 -

+

6

@@ -1696,36 +1097,24 @@ These should not be escaped: \$ \\ \> \[ \{ -

- 1 -

+

1

-

- 2 -

+

2

-

- 3 -

+

3

-

- 4 -

+

4

-

- 5 -

+

5

-

- 6 -

+

6

@@ -1737,36 +1126,24 @@ These should not be escaped: \$ \\ \> \[ \{ -

- 1 -

+

1

-

- 2 -

+

2

-

- 3 -

+

3

-

- 4 -

+

4

-

- 5 -

+

5

-

- 6 -

+

6

@@ -1774,9 +1151,7 @@ These should not be escaped: \$ \\ \> \[ \{
Empty Tables -

- This section should be empty. -

+

This section should be empty.

diff --git a/test/tables.jats b/test/tables.jats index 46af61635..50e8498f4 100644 --- a/test/tables.jats +++ b/test/tables.jats @@ -1,11 +1,7 @@ -

- Simple table with caption: -

+

Simple table with caption:

-

- Demonstration of simple table syntax. -

+

Demonstration of simple table syntax.

@@ -14,69 +10,35 @@ - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + +
- Right - - Left - - Center - - Default - RightLeftCenterDefault
- 12 - - 12 - - 12 - - 12 - 12121212
- 123 - - 123 - - 123 - - 123 - 123123123123
- 1 - - 1 - - 1 - - 1 - 1111
-

- Simple table without caption: -

+

Simple table without caption:

@@ -84,73 +46,37 @@ - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + +
- Right - - Left - - Center - - Default - RightLeftCenterDefault
- 12 - - 12 - - 12 - - 12 - 12121212
- 123 - - 123 - - 123 - - 123 - 123123123123
- 1 - - 1 - - 1 - - 1 - 1111
-

- Simple table indented two spaces: -

+

Simple table indented two spaces:

-

- Demonstration of simple table syntax. -

+

Demonstration of simple table syntax.

@@ -159,74 +85,38 @@ - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + +
- Right - - Left - - Center - - Default - RightLeftCenterDefault
- 12 - - 12 - - 12 - - 12 - 12121212
- 123 - - 123 - - 123 - - 123 - 123123123123
- 1 - - 1 - - 1 - - 1 - 1111
-

- Multiline table with caption: -

+

Multiline table with caption:

-

- Here’s the caption. It may span multiple lines. -

+

Here’s the caption. It may span multiple lines.

@@ -235,55 +125,29 @@ - - - - + + + + - - - - + + + + - - - - + + + +
- Centered Header - - Left Aligned - - Right Aligned - - Default aligned - Centered HeaderLeft AlignedRight AlignedDefault aligned
- First - - row - - 12.0 - - Example of a row that spans multiple lines. - Firstrow12.0Example of a row that spans multiple lines.
- Second - - row - - 5.0 - - Here’s another one. Note the blank line between rows. - Secondrow5.0Here’s another one. Note the blank line between rows.
-

- Multiline table without caption: -

+

Multiline table without caption:

@@ -291,54 +155,28 @@ - - - - + + + + - - - - + + + + - - - - + + + +
- Centered Header - - Left Aligned - - Right Aligned - - Default aligned - Centered HeaderLeft AlignedRight AlignedDefault aligned
- First - - row - - 12.0 - - Example of a row that spans multiple lines. - Firstrow12.0Example of a row that spans multiple lines.
- Second - - row - - 5.0 - - Here’s another one. Note the blank line between rows. - Secondrow5.0Here’s another one. Note the blank line between rows.
-

- Table without column headers: -

+

Table without column headers:

@@ -346,52 +184,26 @@ - - - - + + + + - - - - + + + + - - - - + + + +
- 12 - - 12 - - 12 - - 12 - 12121212
- 123 - - 123 - - 123 - - 123 - 123123123123
- 1 - - 1 - - 1 - - 1 - 1111
-

- Multiline table without column headers: -

+

Multiline table without column headers:

@@ -399,32 +211,16 @@ - - - - + + + + - - - - + + + +
- First - - row - - 12.0 - - Example of a row that spans multiple lines. - Firstrow12.0Example of a row that spans multiple lines.
- Second - - row - - 5.0 - - Here’s another one. Note the blank line between rows. - Secondrow5.0Here’s another one. Note the blank line between rows.
diff --git a/test/writer.jats b/test/writer.jats index 507e9f672..b51addf3b 100644 --- a/test/writer.jats +++ b/test/writer.jats @@ -32,10 +32,8 @@ -

- This is a set of tests for pandoc. Most of them are adapted from John - Gruber’s markdown test suite. -

+

This is a set of tests for pandoc. Most of them are adapted from John +Gruber’s markdown test suite.

Headers @@ -59,93 +57,57 @@ Level 2 with <italic>emphasis</italic> Level 3 -

- with no blank line -

+

with no blank line

Level 2 -

- with no blank line -

+

with no blank line

Paragraphs -

- Here’s a regular paragraph. -

-

- In Markdown 1.0.0 and earlier. Version 8. This line turns into a list - item. Because a hard-wrapped line in the middle of a paragraph looked like - a list item. -

-

- Here’s one with a bullet. * criminey. -

-

- There should be a hard line breakhere. -

+

Here’s a regular paragraph.

+

In Markdown 1.0.0 and earlier. Version 8. This line turns into a list + item. Because a hard-wrapped line in the middle of a paragraph looked like a + list item.

+

Here’s one with a bullet. * criminey.

+

There should be a hard line breakhere.

Block Quotes -

- E-mail style: -

+

E-mail style:

-

- This is a block quote. It is pretty short. -

+

This is a block quote. It is pretty short.

-

- Code in a block quote: -

+

Code in a block quote:

sub status { print "working"; } -

- A list: -

+

A list:

-

- item one -

+

item one

-

- item two -

+

item two

-

- Nested block quotes: -

+

Nested block quotes:

-

- nested -

+

nested

-

- nested -

+

nested

-

- This should not be a block quote: 2 > 1. -

-

- And a following paragraph. -

+

This should not be a block quote: 2 > 1.

+

And a following paragraph.

Code Blocks -

- Code: -

+

Code:

---- (should be four hyphens) sub status { @@ -153,9 +115,7 @@ sub status { } this code block is indented by one tab -

- And: -

+

And:

this code block is indented by two tabs These should not be escaped: \$ \\ \> \[ \{ @@ -164,231 +124,141 @@ These should not be escaped: \$ \\ \> \[ \{ Lists Unordered -

- Asterisks tight: -

+

Asterisks tight:

-

- asterisk 1 -

+

asterisk 1

-

- asterisk 2 -

+

asterisk 2

-

- asterisk 3 -

+

asterisk 3

-

- Asterisks loose: -

+

Asterisks loose:

-

- asterisk 1 -

+

asterisk 1

-

- asterisk 2 -

+

asterisk 2

-

- asterisk 3 -

+

asterisk 3

-

- Pluses tight: -

+

Pluses tight:

-

- Plus 1 -

+

Plus 1

-

- Plus 2 -

+

Plus 2

-

- Plus 3 -

+

Plus 3

-

- Pluses loose: -

+

Pluses loose:

-

- Plus 1 -

+

Plus 1

-

- Plus 2 -

+

Plus 2

-

- Plus 3 -

+

Plus 3

-

- Minuses tight: -

+

Minuses tight:

-

- Minus 1 -

+

Minus 1

-

- Minus 2 -

+

Minus 2

-

- Minus 3 -

+

Minus 3

-

- Minuses loose: -

+

Minuses loose:

-

- Minus 1 -

+

Minus 1

-

- Minus 2 -

+

Minus 2

-

- Minus 3 -

+

Minus 3

Ordered -

- Tight: -

+

Tight:

-

- First -

+

First

-

- Second -

+

Second

-

- Third -

+

Third

-

- and: -

+

and:

-

- One -

+

One

-

- Two -

+

Two

-

- Three -

+

Three

-

- Loose using tabs: -

+

Loose using tabs:

-

- First -

+

First

-

- Second -

+

Second

-

- Third -

+

Third

-

- and using spaces: -

+

and using spaces:

-

- One -

+

One

-

- Two -

+

Two

-

- Three -

+

Three

-

- Multiple paragraphs: -

+

Multiple paragraphs:

-

- Item 1, graf one. -

-

- Item 1. graf two. The quick brown fox jumped over the lazy dog’s - back. -

+

Item 1, graf one.

+

Item 1. graf two. The quick brown fox jumped over the lazy dog’s + back.

-

- Item 2. -

+

Item 2.

-

- Item 3. -

+

Item 3.

@@ -396,97 +266,63 @@ These should not be escaped: \$ \\ \> \[ \{ Nested -

- Tab -

+

Tab

-

- Tab -

+

Tab

-

- Tab -

+

Tab

-

- Here’s another: -

+

Here’s another:

-

- First -

+

First

-

- Second: -

+

Second:

-

- Fee -

+

Fee

-

- Fie -

+

Fie

-

- Foe -

+

Foe

-

- Third -

+

Third

-

- Same thing but with paragraphs: -

+

Same thing but with paragraphs:

-

- First -

+

First

-

- Second: -

+

Second:

-

- Fee -

+

Fee

-

- Fie -

+

Fie

-

- Foe -

+

Foe

-

- Third -

+

Third

@@ -494,24 +330,16 @@ These should not be escaped: \$ \\ \> \[ \{ Tabs and spaces -

- this is a list item indented with tabs -

+

this is a list item indented with tabs

-

- this is a list item indented with spaces -

+

this is a list item indented with spaces

-

- this is an example list item indented with tabs -

+

this is an example list item indented with tabs

-

- this is an example list item indented with spaces -

+

this is an example list item indented with spaces

@@ -521,90 +349,50 @@ These should not be escaped: \$ \\ \> \[ \{ Fancy list markers - -

- begins with 2 -

+ +

begins with 2

- -

- and now 3 -

-

- with a continuation -

+ +

and now 3

+

with a continuation

- -

- sublist with roman numerals, starting with 4 -

+ +

sublist with roman numerals, starting with 4

- -

- more items -

+ +

more items

- -

- a subsublist -

+ +

a subsublist

- -

- a subsublist -

+ +

a subsublist

-

- Nesting: -

+

Nesting:

-

- Upper Alpha -

+

Upper Alpha

-

- Upper Roman. -

+

Upper Roman.

- -

- Decimal start with 6 -

+ +

Decimal start with 6

- -

- Lower alpha with paren -

+ +

Lower alpha with paren

@@ -613,277 +401,163 @@ These should not be escaped: \$ \\ \> \[ \{
-

- Autonumbering: -

+

Autonumbering:

-

- Autonumber. -

+

Autonumber.

-

- More. -

+

More.

-

- Nested. -

+

Nested.

-

- Should not be a list item: -

-

- M.A. 2007 -

-

- B. Williams -

+

Should not be a list item:

+

M.A. 2007

+

B. Williams

Definition Lists -

- Tight using spaces: -

+

Tight using spaces:

- - apple - + apple -

- red fruit -

+

red fruit

- - orange - + orange -

- orange fruit -

+

orange fruit

- - banana - + banana -

- yellow fruit -

+

yellow fruit

-

- Tight using tabs: -

+

Tight using tabs:

- - apple - + apple -

- red fruit -

+

red fruit

- - orange - + orange -

- orange fruit -

+

orange fruit

- - banana - + banana -

- yellow fruit -

+

yellow fruit

-

- Loose: -

+

Loose:

- - apple - + apple -

- red fruit -

+

red fruit

- - orange - + orange -

- orange fruit -

+

orange fruit

- - banana - + banana -

- yellow fruit -

+

yellow fruit

-

- Multiple blocks with italics: -

+

Multiple blocks with italics:

- - apple - + apple -

- red fruit -

-

- contains seeds, crisp, pleasant to taste -

+

red fruit

+

contains seeds, crisp, pleasant to taste

- - orange - + orange -

- orange fruit -

+

orange fruit

{ orange code block } -

- orange block quote -

+

orange block quote

-

- Multiple definitions, tight: -

+

Multiple definitions, tight:

- - apple - + apple -

- red fruit -

-

- computer -

+

red fruit

+

computer

- - orange - + orange -

- orange fruit -

-

- bank -

+

orange fruit

+

bank

-

- Multiple definitions, loose: -

+

Multiple definitions, loose:

- - apple - + apple -

- red fruit -

-

- computer -

+

red fruit

+

computer

- - orange - + orange -

- orange fruit -

-

- bank -

+

orange fruit

+

bank

-

- Blank line after term, indented marker, alternate markers: -

+

Blank line after term, indented marker, alternate markers:

- - apple - + apple -

- red fruit -

-

- computer -

+

red fruit

+

computer

- - orange - + orange -

- orange fruit -

+

orange fruit

-

- sublist -

+

sublist

-

- sublist -

+

sublist

@@ -892,555 +566,315 @@ These should not be escaped: \$ \\ \> \[ \{
HTML Blocks -

- Simple block on one line: -

+

Simple block on one line:

-

- foo -

+

foo

-

- And nested without indentation: -

+

And nested without indentation:

-

- foo -

+

foo

-

- bar -

+

bar

-

- Interpreted markdown in a table: -

-

- This is emphasized -

-

- And this is strong -

-

- Here’s a simple block: -

+

Interpreted markdown in a table:

+

This is emphasized

+

And this is strong

+

Here’s a simple block:

-

- foo -

+

foo

-

- This should be a code block, though: -

+

This should be a code block, though:

<div> foo </div> -

- As should this: -

+

As should this:

<div>foo</div> -

- Now, nested: -

+

Now, nested:

-

- foo -

+

foo

-

- This should just be an HTML comment: -

-

- Multiline: -

-

- Code block: -

+

This should just be an HTML comment:

+

Multiline:

+

Code block:

<!-- Comment --> -

- Just plain comment, with trailing spaces on the line: -

-

- Code: -

+

Just plain comment, with trailing spaces on the line:

+

Code:

<hr /> -

- Hr’s: -

+

Hr’s:

Inline Markup -

- This is emphasized, and so is this. -

-

- This is strong, and so is - this. -

-

- An emphasized - link. -

-

- This is strong and em. -

-

- So is this word. -

-

- This is strong and em. -

-

- So is this word. -

-

- This is code: >, $, - \, \$, - <html>. -

-

- This is strikeout. -

-

- Superscripts: abcd ahello - ahello there. -

-

- Subscripts: H2O, H23O, Hmany of themO. -

-

- These should not be superscripts or subscripts, because of the unescaped - spaces: a^b c^d, a~b c~d. -

+

This is emphasized, and so is this.

+

This is strong, and so is + this.

+

An emphasized + link.

+

This is strong and em.

+

So is this word.

+

This is strong and em.

+

So is this word.

+

This is code: >, $, + \, \$, + <html>.

+

This is strikeout.

+

Superscripts: abcd ahello + ahello there.

+

Subscripts: H2O, H23O, + Hmany of themO.

+

These should not be superscripts or subscripts, because of the unescaped + spaces: a^b c^d, a~b c~d.

Smart quotes, ellipses, dashes -

- “Hello,” said the spider. “‘Shelob’ is my name.” -

-

- ‘A’, ‘B’, and ‘C’ are letters. -

-

- ‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. So is ‘pine.’ -

-

- ‘He said, “I want to go.”’ Were you alive in the 70’s? -

-

- Here is some quoted ‘code’ and a - “quoted - link”. -

-

- Some dashes: one—two — three—four — five. -

-

- Dashes between numbers: 5–7, 255–66, 1987–1999. -

-

- Ellipses…and…and…. -

+

“Hello,” said the spider. “‘Shelob’ is my name.”

+

‘A’, ‘B’, and ‘C’ are letters.

+

‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. So is ‘pine.’

+

‘He said, “I want to go.”’ Were you alive in the 70’s?

+

Here is some quoted ‘code’ and a + “quoted + link”.

+

Some dashes: one—two — three—four — five.

+

Dashes between numbers: 5–7, 255–66, 1987–1999.

+

Ellipses…and…and….

LaTeX -

-

+

-

- - - 2+2=4 -

+

+ + 2+2=4

-

- - - xy -

+

+ + xy

-

- - - αω -

+

+ + αω

-

- - - 223 -

+

+ + 223

-

- - - p-Tree -

+

+ + p-Tree

-

- Here’s some display math: - - ddxf(x)=limh0f(x+h)f(x)h -

+

Here’s some display math: + + ddxf(x)=limh0f(x+h)f(x)h

-

- Here’s one that has a line break in it: - - α+ω×x2. -

+

Here’s one that has a line break in it: + + + α+ω×x2.

-

- These shouldn’t be math: -

+

These shouldn’t be math:

-

- To get the famous equation, write $e = mc^2$. -

+

To get the famous equation, write + $e = mc^2$.

-

- $22,000 is a lot of money. So is $34,000. (It worked - if “lot” is emphasized.) -

+

$22,000 is a lot of money. So is $34,000. (It worked + if “lot” is emphasized.)

-

- Shoes ($20) and socks ($5). -

+

Shoes ($20) and socks ($5).

-

- Escaped $: $73 this should be - emphasized 23$. -

+

Escaped $: $73 this should be + emphasized 23$.

-

- Here’s a LaTeX table: -

+

Here’s a LaTeX table:

Special Characters -

- Here is some unicode: -

+

Here is some unicode:

-

- I hat: Î -

+

I hat: Î

-

- o umlaut: ö -

+

o umlaut: ö

-

- section: § -

+

section: §

-

- set membership: ∈ -

+

set membership: ∈

-

- copyright: © -

+

copyright: ©

-

- AT&T has an ampersand in their name. -

-

- AT&T is another way to write it. -

-

- This & that. -

-

- 4 < 5. -

-

- 6 > 5. -

-

- Backslash: \ -

-

- Backtick: ` -

-

- Asterisk: * -

-

- Underscore: _ -

-

- Left brace: { -

-

- Right brace: } -

-

- Left bracket: [ -

-

- Right bracket: ] -

-

- Left paren: ( -

-

- Right paren: ) -

-

- Greater-than: > -

-

- Hash: # -

-

- Period: . -

-

- Bang: ! -

-

- Plus: + -

-

- Minus: - -

+

AT&T has an ampersand in their name.

+

AT&T is another way to write it.

+

This & that.

+

4 < 5.

+

6 > 5.

+

Backslash: \

+

Backtick: `

+

Asterisk: *

+

Underscore: _

+

Left brace: {

+

Right brace: }

+

Left bracket: [

+

Right bracket: ]

+

Left paren: (

+

Right paren: )

+

Greater-than: >

+

Hash: #

+

Period: .

+

Bang: !

+

Plus: +

+

Minus: -

Links Explicit -

- Just a URL. -

-

- URL - and title. -

-

- URL - and title. -

-

- URL - and title. -

-

- URL - and title -

-

- URL - and title -

-

- with_underscore -

-

- Email - link -

-

- Empty. -

+

Just a + URL.

+

URL + and title.

+

URL + and title.

+

URL + and title.

+

URL + and title

+

URL + and title

+

with_underscore

+

Email + link

+

Empty.

Reference -

- Foo bar. -

-

- With embedded - [brackets]. -

-

- b by itself - should be a link. -

-

- Indented - once. -

-

- Indented - twice. -

-

- Indented - thrice. -

-

- This should [not][] be a link. -

+

Foo + bar.

+

With embedded + [brackets].

+

b by itself + should be a link.

+

Indented + once.

+

Indented + twice.

+

Indented + thrice.

+

This should [not][] be a link.

[not]: /url -

- Foo - bar. -

-

- Foo - biz. -

+

Foo + bar.

+

Foo + biz.

With ampersands -

- Here’s a - link - with an ampersand in the URL. -

-

- Here’s a link with an amersand in the link text: - AT&T. -

-

- Here’s an - inline - link. -

-

- Here’s an - inline - link in pointy braces. -

+

Here’s a + link + with an ampersand in the URL.

+

Here’s a link with an amersand in the link text: + AT&T.

+

Here’s an + inline + link.

+

Here’s an + inline + link in pointy braces.

Autolinks -

- With an ampersand: - http://example.com/?foo=1&bar=2 -

+

With an ampersand: + http://example.com/?foo=1&bar=2

-

- In a list? -

+

In a list?

-

- http://example.com/ -

+

http://example.com/

-

- It should. -

+

It should.

-

- An e-mail address: nobody@nowhere.net -

+

An e-mail address: nobody@nowhere.net

-

- Blockquoted: - http://example.com/ -

+

Blockquoted: + http://example.com/

-

- Auto-links should not occur here: - <http://example.com/> -

+

Auto-links should not occur here: + <http://example.com/>

or here: <http://example.com/>
Images -

- From “Voyage dans la Lune” by Georges Melies (1902): -

+

From “Voyage dans la Lune” by Georges Melies (1902):

lalune -

- Here is a movie - - icon. -

+

Here is a movie + + icon.

Footnotes -

- Here is a footnote reference, -

- Here is the footnote. It can go anywhere after the footnote reference. - It need not be placed at the end of the document. -

- and another. -

- Here’s the long note. This one contains multiple blocks. -

-

- Subsequent blocks are indented to show that they belong to the - footnote (as with list items). -

- { <code> } -

- If you want, you can indent every line, but you can also be lazy and - just indent the first line of each block. -

-
This should not be a footnote reference, because it - contains a space.[^my note] Here is an inline note. -

- This is easier to type. Inline notes may contain - links - and ] verbatim characters, as well as - [bracketed text]. -

-
-

+

Here is a footnote reference, +

Here is the footnote. It can go anywhere after the footnote reference. + It need not be placed at the end of the document.

+ and another. +

Here’s the long note. This one contains multiple blocks.

+

Subsequent blocks are indented to show that they belong to the footnote + (as with list items).

+ { <code> } +

If you want, you can indent every line, but you can also be lazy and + just indent the first line of each block.

+
This should not be a footnote reference, because it + contains a space.[^my note] Here is an inline note. +

This is easier to type. Inline notes may contain + links + and ] verbatim characters, as well as [bracketed + text].

+

-

- Notes can go in quotes. -

- In quote. -

- -

+

Notes can go in quotes. +

In quote.

+

-

- And in list items. -

- In list. -

- -

+

And in list items. +

In list.

+

-

- This paragraph should not be part of the note, as it is not indented. -

+

This paragraph should not be part of the note, as it is not indented.

-- cgit v1.2.3