git.iko.soy/typeable/pandoc
on master help sign in
Revert "Better indentation under headers in org mode output."

This reverts commit 1a81751cef330d875cc34f11cde4a0d478969db7.

commitfe42c175ebf105b32f342a1609417ce632f317e1 authorJohn MacFarlane <jgm@berkeley.edu> dateSat 4 Nov 2017, 11:32 (9 years ago) parent1a81751
2 files changed+424−432
src/Text/Pandoc/Writers/Org.hs+14−26 test/writer.org+410−406
src/Text/Pandoc/Writers/Org.hs+14−26
@@ -77,7 +77,7 @@ pandocToOrg (Pandoc meta blocks) = do
7777 (fmap render' . blockListToOrg)
7878 (fmap render' . inlineListToOrg)
7979 meta
80− body <- vcat <$> mapM (elementToOrg 0) (hierarchicalize blocks)
80+ body <- blockListToOrg blocks
8181 notes <- gets (reverse . stNotes) >>= notesToOrg
8282 hasMath <- gets stHasMath
8383 let main = render colwidth . foldl ($+$) empty $ [body, notes]
@@ -96,9 +96,9 @@ notesToOrg notes =
9696-- | Return Org representation of a note.
9797noteToOrg :: PandocMonad m => Int -> [Block] -> Org m Doc
9898noteToOrg num note = do
99− contents <- vcat <$> mapM (elementToOrg 0) (hierarchicalize note)
99+ contents <- blockListToOrg note
100100 let marker = "[fn:" ++ show num ++ "] "
101− return $ hang (length marker) (text marker) $ contents
101+ return $ hang (length marker) (text marker) contents
102102
103103-- | Escape special characters for Org.
104104escapeString :: String -> String
@@ -113,18 +113,6 @@ isRawFormat :: Format -> Bool
113113isRawFormat f =
114114 f == Format "latex" || f == Format "tex" || f == Format "org"
115115
116−elementToOrg :: PandocMonad m
117− => Int -> Element -> Org m Doc
118−elementToOrg nestlevel (Blk block) = do
119− contents <- blockToOrg block
120− if isEmpty contents
121− then return empty
122− else return $ nest nestlevel contents $$ blankline
123−elementToOrg _nestlevel (Sec level _num attr title' elements) = do
124− hdr <- blockToOrg (Header level attr title')
125− body <- vcat <$> mapM (elementToOrg (level + 1)) elements
126− return $ hdr $$ body
127−
128116-- | Convert Pandoc block element to Org.
129117blockToOrg :: PandocMonad m
130118 => Block -- ^ Block element
@@ -152,14 +140,14 @@ blockToOrg (Div (ident, classes, kv) bs) = do
152140 (blockType:classes'') ->
153141 blankline $$ attrHtml (ident, classes'' <> classes', kv) $$
154142 "#+BEGIN_" <> text blockType $$ contents $$
155− "#+END_" <> text blockType
143+ "#+END_" <> text blockType $$ blankline
156144 _ ->
157145 -- fallback with id: add id as an anchor if present, discard classes and
158146 -- key-value pairs, unwrap the content.
159147 let contents' = if not (null ident)
160148 then "<<" <> text ident <> ">>" $$ contents
161149 else contents
162− in blankline $$ contents'
150+ in blankline $$ contents' $$ blankline
163151blockToOrg (Plain inlines) = inlineListToOrg inlines
164152-- title beginning with fig: indicates that the image is a figure
165153blockToOrg (Para [Image attr txt (src,'f':'i':'g':':':tit)]) = do
@@ -167,7 +155,7 @@ blockToOrg (Para [Image attr txt (src,'f':'i':'g':':':tit)]) = do
167155 then return empty
168156 else ("#+CAPTION: " <>) `fmap` inlineListToOrg txt
169157 img <- inlineToOrg (Image attr txt (src,tit))
170− return $ capt $$ img
158+ return $ capt $$ img $$ blankline
171159blockToOrg (Para inlines) = do
172160 contents <- inlineListToOrg inlines
173161 return $ contents <> blankline
@@ -184,13 +172,13 @@ blockToOrg (LineBlock lns) = do
184172 nest 2 contents $$ "#+END_VERSE" <> blankline
185173blockToOrg (RawBlock "html" str) =
186174 return $ blankline $$ "#+BEGIN_HTML" $$
187− nest 2 (text str) $$ "#+END_HTML"
175+ nest 2 (text str) $$ "#+END_HTML" $$ blankline
188176blockToOrg b@(RawBlock f str)
189177 | isRawFormat f = return $ text str
190178 | otherwise = do
191179 report $ BlockNotRendered b
192180 return empty
193−blockToOrg HorizontalRule = return $ blankline $$ "--------------"
181+blockToOrg HorizontalRule = return $ blankline $$ "--------------" $$ blankline
194182blockToOrg (Header level attr inlines) = do
195183 contents <- inlineListToOrg inlines
196184 let headerStr = text $ if level > 999 then " " else replicate level '*'
@@ -205,11 +193,11 @@ blockToOrg (CodeBlock (_,classes,_) str) = do
205193 let (beg, end) = case at of
206194 [] -> ("#+BEGIN_EXAMPLE", "#+END_EXAMPLE")
207195 (x:_) -> ("#+BEGIN_SRC " ++ x, "#+END_SRC")
208− return $ text beg $$ nest tabstop (text str) $$ text end
196+ return $ text beg $$ nest tabstop (text str) $$ text end $$ blankline
209197blockToOrg (BlockQuote blocks) = do
210198 contents <- blockListToOrg blocks
211199 return $ blankline $$ "#+BEGIN_QUOTE" $$
212− nest 2 contents $$ "#+END_QUOTE"
200+ nest 2 contents $$ "#+END_QUOTE" $$ blankline
213201blockToOrg (Table caption' _ _ headers rows) = do
214202 caption'' <- inlineListToOrg caption'
215203 let caption = if null caption'
@@ -240,11 +228,11 @@ blockToOrg (Table caption' _ _ headers rows) = do
240228 let head'' = if all null headers
241229 then empty
242230 else head' $$ border '-'
243− return $ head'' $$ body $$ caption
231+ return $ head'' $$ body $$ caption $$ blankline
244232blockToOrg (BulletList items) = do
245233 contents <- mapM bulletListItemToOrg items
246234 -- ensure that sublists have preceding blank line
247− return $ blankline $+$ vcat contents
235+ return $ blankline $+$ vcat contents $$ blankline
248236blockToOrg (OrderedList (start, _, delim) items) = do
249237 let delim' = case delim of
250238 TwoParens -> OneParen
@@ -256,10 +244,10 @@ blockToOrg (OrderedList (start, _, delim) items) = do
256244 in m ++ replicate s ' ') markers
257245 contents <- zipWithM orderedListItemToOrg markers' items
258246 -- ensure that sublists have preceding blank line
259− return $ blankline $$ vcat contents
247+ return $ blankline $$ vcat contents $$ blankline
260248blockToOrg (DefinitionList items) = do
261249 contents <- mapM definitionListItemToOrg items
262− return $ vcat contents
250+ return $ vcat contents $$ blankline
263251
264252-- | Convert bullet list item (list of blocks) to Org.
265253bulletListItemToOrg :: PandocMonad m => [Block] -> Org m Doc
test/writer.org+410−406
@@ -48,101 +48,103 @@ markdown test suite.
4848 :CUSTOM_ID: level-3
4949 :END:
5050
51− with no blank line
51+with no blank line
5252
5353** Level 2
5454 :PROPERTIES:
5555 :CUSTOM_ID: level-2
5656 :END:
5757
58− with no blank line
58+with no blank line
5959
60− --------------
60+--------------
6161
6262* Paragraphs
6363 :PROPERTIES:
6464 :CUSTOM_ID: paragraphs
6565 :END:
6666
67− Here's a regular paragraph.
67+Here's a regular paragraph.
6868
69− In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.
70− Because a hard-wrapped line in the middle of a paragraph looked like a list
71− item.
69+In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.
70+Because a hard-wrapped line in the middle of a paragraph looked like a list
71+item.
7272
73− Here's one with a bullet. * criminey.
73+Here's one with a bullet. * criminey.
7474
75− There should be a hard line break\\
76− here.
75+There should be a hard line break\\
76+here.
7777
78− --------------
78+--------------
7979
8080* Block Quotes
8181 :PROPERTIES:
8282 :CUSTOM_ID: block-quotes
8383 :END:
8484
85− E-mail style:
85+E-mail style:
86+
87+#+BEGIN_QUOTE
88+ This is a block quote. It is pretty short.
89+#+END_QUOTE
90+
91+#+BEGIN_QUOTE
92+ Code in a block quote:
93+
94+ #+BEGIN_EXAMPLE
95+ sub status {
96+ print "working";
97+ }
98+ #+END_EXAMPLE
99+
100+ A list:
101+
102+ 1. item one
103+ 2. item two
104+
105+ Nested block quotes:
86106
87107 #+BEGIN_QUOTE
88− This is a block quote. It is pretty short.
108+ nested
89109 #+END_QUOTE
90110
91111 #+BEGIN_QUOTE
92− Code in a block quote:
93−
94− #+BEGIN_EXAMPLE
95− sub status {
96− print "working";
97− }
98− #+END_EXAMPLE
99− A list:
100−
101− 1. item one
102− 2. item two
103− Nested block quotes:
104−
105− #+BEGIN_QUOTE
106− nested
107− #+END_QUOTE
108−
109− #+BEGIN_QUOTE
110− nested
111− #+END_QUOTE
112+ nested
112113 #+END_QUOTE
114+#+END_QUOTE
113115
114− This should not be a block quote: 2 > 1.
116+This should not be a block quote: 2 > 1.
115117
116− And a following paragraph.
118+And a following paragraph.
117119
118− --------------
120+--------------
119121
120122* Code Blocks
121123 :PROPERTIES:
122124 :CUSTOM_ID: code-blocks
123125 :END:
124126
125− Code:
127+Code:
126128
127− #+BEGIN_EXAMPLE
128− ---- (should be four hyphens)
129+#+BEGIN_EXAMPLE
130+ ---- (should be four hyphens)
129131
130− sub status {
131− print "working";
132− }
132+ sub status {
133+ print "working";
134+ }
133135
134− this code block is indented by one tab
135− #+END_EXAMPLE
136+ this code block is indented by one tab
137+#+END_EXAMPLE
136138
137− And:
139+And:
138140
139− #+BEGIN_EXAMPLE
140− this code block is indented by two tabs
141+#+BEGIN_EXAMPLE
142+ this code block is indented by two tabs
141143
142− These should not be escaped: \$ \\ \> \[ \{
143− #+END_EXAMPLE
144+ These should not be escaped: \$ \\ \> \[ \{
145+#+END_EXAMPLE
144146
145− --------------
147+--------------
146148
147149* Lists
148150 :PROPERTIES:
@@ -154,549 +156,551 @@ markdown test suite.
154156 :CUSTOM_ID: unordered
155157 :END:
156158
157− Asterisks tight:
159+Asterisks tight:
158160
159− - asterisk 1
160− - asterisk 2
161− - asterisk 3
161+- asterisk 1
162+- asterisk 2
163+- asterisk 3
162164
163− Asterisks loose:
165+Asterisks loose:
164166
165− - asterisk 1
167+- asterisk 1
166168
167− - asterisk 2
169+- asterisk 2
168170
169− - asterisk 3
171+- asterisk 3
170172
171− Pluses tight:
173+Pluses tight:
172174
173− - Plus 1
174− - Plus 2
175− - Plus 3
175+- Plus 1
176+- Plus 2
177+- Plus 3
176178
177− Pluses loose:
179+Pluses loose:
178180
179− - Plus 1
181+- Plus 1
180182
181− - Plus 2
183+- Plus 2
182184
183− - Plus 3
185+- Plus 3
184186
185− Minuses tight:
187+Minuses tight:
186188
187− - Minus 1
188− - Minus 2
189− - Minus 3
189+- Minus 1
190+- Minus 2
191+- Minus 3
190192
191− Minuses loose:
193+Minuses loose:
192194
193− - Minus 1
195+- Minus 1
194196
195− - Minus 2
197+- Minus 2
196198
197− - Minus 3
199+- Minus 3
198200
199201** Ordered
200202 :PROPERTIES:
201203 :CUSTOM_ID: ordered
202204 :END:
203205
204− Tight:
206+Tight:
205207
206− 1. First
207− 2. Second
208− 3. Third
208+1. First
209+2. Second
210+3. Third
209211
210− and:
212+and:
211213
212− 1. One
213− 2. Two
214− 3. Three
214+1. One
215+2. Two
216+3. Three
215217
216− Loose using tabs:
218+Loose using tabs:
217219
218− 1. First
220+1. First
219221
220− 2. Second
222+2. Second
221223
222− 3. Third
224+3. Third
223225
224− and using spaces:
226+and using spaces:
225227
226− 1. One
228+1. One
227229
228− 2. Two
230+2. Two
229231
230− 3. Three
232+3. Three
231233
232− Multiple paragraphs:
234+Multiple paragraphs:
233235
234− 1. Item 1, graf one.
236+1. Item 1, graf one.
235237
236− Item 1. graf two. The quick brown fox jumped over the lazy dog's back.
238+ Item 1. graf two. The quick brown fox jumped over the lazy dog's back.
237239
238− 2. Item 2.
240+2. Item 2.
239241
240− 3. Item 3.
242+3. Item 3.
241243
242244** Nested
243245 :PROPERTIES:
244246 :CUSTOM_ID: nested
245247 :END:
246248
247− - Tab
249+- Tab
250+
251+ - Tab
252+
253+ - Tab
248254
249− - Tab
255+Here's another:
250256
251− - Tab
257+1. First
258+2. Second:
252259
253− Here's another:
260+ - Fee
261+ - Fie
262+ - Foe
254263
255− 1. First
256− 2. Second:
264+3. Third
257265
258− - Fee
259− - Fie
260− - Foe
261− 3. Third
266+Same thing but with paragraphs:
262267
263− Same thing but with paragraphs:
268+1. First
264269
265− 1. First
270+2. Second:
266271
267− 2. Second:
272+ - Fee
273+ - Fie
274+ - Foe
268275
269− - Fee
270− - Fie
271− - Foe
272− 3. Third
276+3. Third
273277
274278** Tabs and spaces
275279 :PROPERTIES:
276280 :CUSTOM_ID: tabs-and-spaces
277281 :END:
278282
279− - this is a list item indented with tabs
283+- this is a list item indented with tabs
280284
281− - this is a list item indented with spaces
285+- this is a list item indented with spaces
282286
283− - this is an example list item indented with tabs
287+ - this is an example list item indented with tabs
284288
285− - this is an example list item indented with spaces
289+ - this is an example list item indented with spaces
286290
287291** Fancy list markers
288292 :PROPERTIES:
289293 :CUSTOM_ID: fancy-list-markers
290294 :END:
291295
292− 2) begins with 2
293− 3) and now 3
296+2) begins with 2
297+3) and now 3
294298
295− with a continuation
299+ with a continuation
296300
297− 4. sublist with roman numerals, starting with 4
298− 5. more items
301+ 4. sublist with roman numerals, starting with 4
302+ 5. more items
299303
300− 1) a subsublist
301− 2) a subsublist
304+ 1) a subsublist
305+ 2) a subsublist
302306
303− Nesting:
307+Nesting:
304308
305− 1. Upper Alpha
309+1. Upper Alpha
306310
307− 1. Upper Roman.
311+ 1. Upper Roman.
308312
309− 6) Decimal start with 6
313+ 6) Decimal start with 6
310314
311− 3) Lower alpha with paren
315+ 3) Lower alpha with paren
312316
313− Autonumbering:
317+Autonumbering:
314318
315− 1. Autonumber.
316− 2. More.
319+1. Autonumber.
320+2. More.
317321
318− 1. Nested.
322+ 1. Nested.
319323
320− Should not be a list item:
324+Should not be a list item:
321325
322− M.A. 2007
326+M.A. 2007
323327
324− B. Williams
328+B. Williams
325329
326− --------------
330+--------------
327331
328332* Definition Lists
329333 :PROPERTIES:
330334 :CUSTOM_ID: definition-lists
331335 :END:
332336
333− Tight using spaces:
337+Tight using spaces:
334338
335− - apple :: red fruit
336− - orange :: orange fruit
337− - banana :: yellow fruit
339+- apple :: red fruit
340+- orange :: orange fruit
341+- banana :: yellow fruit
338342
339− Tight using tabs:
343+Tight using tabs:
340344
341− - apple :: red fruit
342− - orange :: orange fruit
343− - banana :: yellow fruit
345+- apple :: red fruit
346+- orange :: orange fruit
347+- banana :: yellow fruit
344348
345− Loose:
349+Loose:
346350
347− - apple :: red fruit
351+- apple :: red fruit
348352
349− - orange :: orange fruit
353+- orange :: orange fruit
350354
351− - banana :: yellow fruit
355+- banana :: yellow fruit
352356
353− Multiple blocks with italics:
357+Multiple blocks with italics:
354358
355− - /apple/ :: red fruit
359+- /apple/ :: red fruit
356360
357− contains seeds, crisp, pleasant to taste
361+ contains seeds, crisp, pleasant to taste
358362
359− - /orange/ :: orange fruit
363+- /orange/ :: orange fruit
360364
361− #+BEGIN_EXAMPLE
362− { orange code block }
363− #+END_EXAMPLE
365+ #+BEGIN_EXAMPLE
366+ { orange code block }
367+ #+END_EXAMPLE
364368
365− #+BEGIN_QUOTE
366− orange block quote
367− #+END_QUOTE
369+ #+BEGIN_QUOTE
370+ orange block quote
371+ #+END_QUOTE
368372
369− Multiple definitions, tight:
373+Multiple definitions, tight:
370374
371− - apple :: red fruit
372− computer
373− - orange :: orange fruit
374− bank
375+- apple :: red fruit
376+ computer
377+- orange :: orange fruit
378+ bank
375379
376− Multiple definitions, loose:
380+Multiple definitions, loose:
377381
378− - apple :: red fruit
382+- apple :: red fruit
379383
380− computer
384+ computer
381385
382− - orange :: orange fruit
386+- orange :: orange fruit
383387
384− bank
388+ bank
385389
386− Blank line after term, indented marker, alternate markers:
390+Blank line after term, indented marker, alternate markers:
387391
388− - apple :: red fruit
392+- apple :: red fruit
389393
390− computer
394+ computer
391395
392− - orange :: orange fruit
396+- orange :: orange fruit
393397
394− 1. sublist
395− 2. sublist
398+ 1. sublist
399+ 2. sublist
396400
397401* HTML Blocks
398402 :PROPERTIES:
399403 :CUSTOM_ID: html-blocks
400404 :END:
401405
402− Simple block on one line:
406+Simple block on one line:
403407
404− foo
408+foo
405409
406− And nested without indentation:
410+And nested without indentation:
407411
408− foo
412+foo
409413
410− bar
414+bar
411415
412− Interpreted markdown in a table:
416+Interpreted markdown in a table:
413417
414− #+BEGIN_HTML
415− <table>
416− #+END_HTML
418+#+BEGIN_HTML
419+ <table>
420+#+END_HTML
417421
418− #+BEGIN_HTML
419− <tr>
420− #+END_HTML
422+#+BEGIN_HTML
423+ <tr>
424+#+END_HTML
421425
422− #+BEGIN_HTML
423− <td>
424− #+END_HTML
426+#+BEGIN_HTML
427+ <td>
428+#+END_HTML
425429
426− This is /emphasized/
430+This is /emphasized/
427431
428− #+BEGIN_HTML
429− </td>
430− #+END_HTML
432+#+BEGIN_HTML
433+ </td>
434+#+END_HTML
431435
432− #+BEGIN_HTML
433− <td>
434− #+END_HTML
436+#+BEGIN_HTML
437+ <td>
438+#+END_HTML
435439
436− And this is *strong*
440+And this is *strong*
437441
438− #+BEGIN_HTML
439− </td>
440− #+END_HTML
442+#+BEGIN_HTML
443+ </td>
444+#+END_HTML
441445
442− #+BEGIN_HTML
443− </tr>
444− #+END_HTML
446+#+BEGIN_HTML
447+ </tr>
448+#+END_HTML
445449
446− #+BEGIN_HTML
447− </table>
448− #+END_HTML
450+#+BEGIN_HTML
451+ </table>
452+#+END_HTML
449453
450− #+BEGIN_HTML
451− <script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
452− #+END_HTML
454+#+BEGIN_HTML
455+ <script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
456+#+END_HTML
453457
454− Here's a simple block:
458+Here's a simple block:
455459
456− foo
460+foo
457461
458− This should be a code block, though:
462+This should be a code block, though:
459463
460− #+BEGIN_EXAMPLE
461− <div>
462− foo
463− </div>
464− #+END_EXAMPLE
464+#+BEGIN_EXAMPLE
465+ <div>
466+ foo
467+ </div>
468+#+END_EXAMPLE
465469
466− As should this:
470+As should this:
467471
468− #+BEGIN_EXAMPLE
469− <div>foo</div>
470− #+END_EXAMPLE
472+#+BEGIN_EXAMPLE
473+ <div>foo</div>
474+#+END_EXAMPLE
471475
472− Now, nested:
476+Now, nested:
473477
474− foo
478+foo
475479
476− This should just be an HTML comment:
480+This should just be an HTML comment:
477481
478− #+BEGIN_HTML
479− <!-- Comment -->
480− #+END_HTML
482+#+BEGIN_HTML
483+ <!-- Comment -->
484+#+END_HTML
481485
482− Multiline:
486+Multiline:
483487
484− #+BEGIN_HTML
485− <!--
486− Blah
487− Blah
488− -->
489− #+END_HTML
488+#+BEGIN_HTML
489+ <!--
490+ Blah
491+ Blah
492+ -->
493+#+END_HTML
490494
491− #+BEGIN_HTML
492− <!--
493− This is another comment.
494− -->
495− #+END_HTML
495+#+BEGIN_HTML
496+ <!--
497+ This is another comment.
498+ -->
499+#+END_HTML
496500
497− Code block:
501+Code block:
498502
499− #+BEGIN_EXAMPLE
500− <!-- Comment -->
501− #+END_EXAMPLE
503+#+BEGIN_EXAMPLE
504+ <!-- Comment -->
505+#+END_EXAMPLE
502506
503− Just plain comment, with trailing spaces on the line:
507+Just plain comment, with trailing spaces on the line:
504508
505− #+BEGIN_HTML
506− <!-- foo -->
507− #+END_HTML
509+#+BEGIN_HTML
510+ <!-- foo -->
511+#+END_HTML
508512
509− Code:
513+Code:
510514
511− #+BEGIN_EXAMPLE
512− <hr />
513− #+END_EXAMPLE
515+#+BEGIN_EXAMPLE
516+ <hr />
517+#+END_EXAMPLE
514518
515− Hr's:
519+Hr's:
516520
517− #+BEGIN_HTML
518− <hr>
519− #+END_HTML
521+#+BEGIN_HTML
522+ <hr>
523+#+END_HTML
520524
521− #+BEGIN_HTML
522− <hr />
523− #+END_HTML
525+#+BEGIN_HTML
526+ <hr />
527+#+END_HTML
524528
525− #+BEGIN_HTML
526− <hr />
527− #+END_HTML
529+#+BEGIN_HTML
530+ <hr />
531+#+END_HTML
528532
529− #+BEGIN_HTML
530− <hr>
531− #+END_HTML
533+#+BEGIN_HTML
534+ <hr>
535+#+END_HTML
532536
533− #+BEGIN_HTML
534− <hr />
535− #+END_HTML
537+#+BEGIN_HTML
538+ <hr />
539+#+END_HTML
536540
537− #+BEGIN_HTML
538− <hr />
539− #+END_HTML
541+#+BEGIN_HTML
542+ <hr />
543+#+END_HTML
540544
541− #+BEGIN_HTML
542− <hr class="foo" id="bar" />
543− #+END_HTML
545+#+BEGIN_HTML
546+ <hr class="foo" id="bar" />
547+#+END_HTML
544548
545− #+BEGIN_HTML
546− <hr class="foo" id="bar" />
547− #+END_HTML
549+#+BEGIN_HTML
550+ <hr class="foo" id="bar" />
551+#+END_HTML
548552
549− #+BEGIN_HTML
550− <hr class="foo" id="bar">
551− #+END_HTML
553+#+BEGIN_HTML
554+ <hr class="foo" id="bar">
555+#+END_HTML
552556
553− --------------
557+--------------
554558
555559* Inline Markup
556560 :PROPERTIES:
557561 :CUSTOM_ID: inline-markup
558562 :END:
559563
560− This is /emphasized/, and so /is this/.
564+This is /emphasized/, and so /is this/.
561565
562− This is *strong*, and so *is this*.
566+This is *strong*, and so *is this*.
563567
564− An /[[/url][emphasized link]]/.
568+An /[[/url][emphasized link]]/.
565569
566− */This is strong and em./*
570+*/This is strong and em./*
567571
568− So is */this/* word.
572+So is */this/* word.
569573
570− */This is strong and em./*
574+*/This is strong and em./*
571575
572− So is */this/* word.
576+So is */this/* word.
573577
574− This is code: =>=, =$=, =\=, =\$=, =<html>=.
578+This is code: =>=, =$=, =\=, =\$=, =<html>=.
575579
576− +This is /strikeout/.+
580++This is /strikeout/.+
577581
578− Superscripts: a^{bc}d a^{/hello/} a^{hello there}.
582+Superscripts: a^{bc}d a^{/hello/} a^{hello there}.
579583
580− Subscripts: H_{2}O, H_{23}O, H_{many of them}O.
584+Subscripts: H_{2}O, H_{23}O, H_{many of them}O.
581585
582− These should not be superscripts or subscripts, because of the unescaped
583− spaces: a\^b c\^d, a~b c~d.
586+These should not be superscripts or subscripts, because of the unescaped
587+spaces: a\^b c\^d, a~b c~d.
584588
585− --------------
589+--------------
586590
587591* Smart quotes, ellipses, dashes
588592 :PROPERTIES:
589593 :CUSTOM_ID: smart-quotes-ellipses-dashes
590594 :END:
591595
592− "Hello," said the spider. "'Shelob' is my name."
596+"Hello," said the spider. "'Shelob' is my name."
593597
594− 'A', 'B', and 'C' are letters.
598+'A', 'B', and 'C' are letters.
595599
596− 'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'
600+'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'
597601
598− 'He said, "I want to go."' Were you alive in the 70's?
602+'He said, "I want to go."' Were you alive in the 70's?
599603
600− Here is some quoted '=code=' and a
601− "[[http://example.com/?foo=1&bar=2][quoted link]]".
604+Here is some quoted '=code=' and a "[[http://example.com/?foo=1&bar=2][quoted
605+link]]".
602606
603− Some dashes: one---two --- three---four --- five.
607+Some dashes: one---two --- three---four --- five.
604608
605− Dashes between numbers: 5--7, 255--66, 1987--1999.
609+Dashes between numbers: 5--7, 255--66, 1987--1999.
606610
607− Ellipses...and...and....
611+Ellipses...and...and....
608612
609− --------------
613+--------------
610614
611615* LaTeX
612616 :PROPERTIES:
613617 :CUSTOM_ID: latex
614618 :END:
615619
616− - \cite[22-23]{smith.1899}
617− - $2+2=4$
618− - $x \in y$
619− - $\alpha \wedge \omega$
620− - $223$
621− - $p$-Tree
622− - Here's some display math:
623− $$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$
624− - Here's one that has a line break in it: $\alpha + \omega \times x^2$.
620+- \cite[22-23]{smith.1899}
621+- $2+2=4$
622+- $x \in y$
623+- $\alpha \wedge \omega$
624+- $223$
625+- $p$-Tree
626+- Here's some display math:
627+ $$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$
628+- Here's one that has a line break in it: $\alpha + \omega \times x^2$.
625629
626− These shouldn't be math:
630+These shouldn't be math:
627631
628− - To get the famous equation, write =$e = mc^2$=.
629− - $22,000 is a /lot/ of money. So is $34,000. (It worked if "lot" is
630− emphasized.)
631− - Shoes ($20) and socks ($5).
632− - Escaped =$=: $73 /this should be emphasized/ 23$.
632+- To get the famous equation, write =$e = mc^2$=.
633+- $22,000 is a /lot/ of money. So is $34,000. (It worked if "lot" is
634+ emphasized.)
635+- Shoes ($20) and socks ($5).
636+- Escaped =$=: $73 /this should be emphasized/ 23$.
633637
634− Here's a LaTeX table:
638+Here's a LaTeX table:
635639
636− \begin{tabular}{|l|l|}\hline
637− Animal & Number \\ \hline
638− Dog & 2 \\
639− Cat & 1 \\ \hline
640− \end{tabular}
640+\begin{tabular}{|l|l|}\hline
641+Animal & Number \\ \hline
642+Dog & 2 \\
643+Cat & 1 \\ \hline
644+\end{tabular}
641645
642− --------------
646+--------------
643647
644648* Special Characters
645649 :PROPERTIES:
646650 :CUSTOM_ID: special-characters
647651 :END:
648652
649− Here is some unicode:
653+Here is some unicode:
650654
651− - I hat: Î
652− - o umlaut: ö
653− - section: §
654− - set membership: ∈
655− - copyright: ©
655+- I hat: Î
656+- o umlaut: ö
657+- section: §
658+- set membership: ∈
659+- copyright: ©
656660
657− AT&T has an ampersand in their name.
661+AT&T has an ampersand in their name.
658662
659− AT&T is another way to write it.
663+AT&T is another way to write it.
660664
661− This & that.
665+This & that.
662666
663− 4 < 5.
667+4 < 5.
664668
665− 6 > 5.
669+6 > 5.
666670
667− Backslash: \
671+Backslash: \
668672
669− Backtick: `
673+Backtick: `
670674
671− Asterisk: *
675+Asterisk: *
672676
673− Underscore: \_
677+Underscore: \_
674678
675− Left brace: {
679+Left brace: {
676680
677− Right brace: }
681+Right brace: }
678682
679− Left bracket: [
683+Left bracket: [
680684
681− Right bracket: ]
685+Right bracket: ]
682686
683− Left paren: (
687+Left paren: (
684688
685− Right paren: )
689+Right paren: )
686690
687− Greater-than: >
691+Greater-than: >
688692
689− Hash: #
693+Hash: #
690694
691− Period: .
695+Period: .
692696
693− Bang: !
697+Bang: !
694698
695− Plus: +
699+Plus: +
696700
697− Minus: -
701+Minus: -
698702
699− --------------
703+--------------
700704
701705* Links
702706 :PROPERTIES:
@@ -708,120 +712,120 @@ markdown test suite.
708712 :CUSTOM_ID: explicit
709713 :END:
710714
711− Just a [[/url/][URL]].
715+Just a [[/url/][URL]].
712716
713− [[/url/][URL and title]].
717+[[/url/][URL and title]].
714718
715− [[/url/][URL and title]].
719+[[/url/][URL and title]].
716720
717− [[/url/][URL and title]].
721+[[/url/][URL and title]].
718722
719− [[/url/][URL and title]]
723+[[/url/][URL and title]]
720724
721− [[/url/][URL and title]]
725+[[/url/][URL and title]]
722726
723− [[/url/with_underscore][with\_underscore]]
727+[[/url/with_underscore][with\_underscore]]
724728
725− [[mailto:nobody@nowhere.net][Email link]]
729+[[mailto:nobody@nowhere.net][Email link]]
726730
727− [[][Empty]].
731+[[][Empty]].
728732
729733** Reference
730734 :PROPERTIES:
731735 :CUSTOM_ID: reference
732736 :END:
733737
734− Foo [[/url/][bar]].
738+Foo [[/url/][bar]].
735739
736− With [[/url/][embedded [brackets]]].
740+With [[/url/][embedded [brackets]]].
737741
738− [[/url/][b]] by itself should be a link.
742+[[/url/][b]] by itself should be a link.
739743
740− Indented [[/url][once]].
744+Indented [[/url][once]].
741745
742− Indented [[/url][twice]].
746+Indented [[/url][twice]].
743747
744− Indented [[/url][thrice]].
748+Indented [[/url][thrice]].
745749
746− This should [not][] be a link.
750+This should [not][] be a link.
747751
748− #+BEGIN_EXAMPLE
749− [not]: /url
750− #+END_EXAMPLE
752+#+BEGIN_EXAMPLE
753+ [not]: /url
754+#+END_EXAMPLE
751755
752− Foo [[/url/][bar]].
756+Foo [[/url/][bar]].
753757
754− Foo [[/url/][biz]].
758+Foo [[/url/][biz]].
755759
756760** With ampersands
757761 :PROPERTIES:
758762 :CUSTOM_ID: with-ampersands
759763 :END:
760764
761− Here's a [[http://example.com/?foo=1&bar=2][link with an ampersand in the
762− URL]].
765+Here's a [[http://example.com/?foo=1&bar=2][link with an ampersand in the
766+URL]].
763767
764− Here's a link with an amersand in the link text: [[http://att.com/][AT&T]].
768+Here's a link with an amersand in the link text: [[http://att.com/][AT&T]].
765769
766− Here's an [[/script?foo=1&bar=2][inline link]].
770+Here's an [[/script?foo=1&bar=2][inline link]].
767771
768− Here's an [[/script?foo=1&bar=2][inline link in pointy braces]].
772+Here's an [[/script?foo=1&bar=2][inline link in pointy braces]].
769773
770774** Autolinks
771775 :PROPERTIES:
772776 :CUSTOM_ID: autolinks
773777 :END:
774778
775− With an ampersand: [[http://example.com/?foo=1&bar=2]]
779+With an ampersand: [[http://example.com/?foo=1&bar=2]]
776780
777− - In a list?
778− - [[http://example.com/]]
779− - It should.
781+- In a list?
782+- [[http://example.com/]]
783+- It should.
780784
781− An e-mail address: [[mailto:nobody@nowhere.net][nobody@nowhere.net]]
785+An e-mail address: [[mailto:nobody@nowhere.net][nobody@nowhere.net]]
782786
783− #+BEGIN_QUOTE
784− Blockquoted: [[http://example.com/]]
785− #+END_QUOTE
787+#+BEGIN_QUOTE
788+ Blockquoted: [[http://example.com/]]
789+#+END_QUOTE
786790
787− Auto-links should not occur here: =<http://example.com/>=
791+Auto-links should not occur here: =<http://example.com/>=
788792
789− #+BEGIN_EXAMPLE
790− or here: <http://example.com/>
791− #+END_EXAMPLE
793+#+BEGIN_EXAMPLE
794+ or here: <http://example.com/>
795+#+END_EXAMPLE
792796
793− --------------
797+--------------
794798
795799* Images
796800 :PROPERTIES:
797801 :CUSTOM_ID: images
798802 :END:
799803
800− From "Voyage dans la Lune" by Georges Melies (1902):
804+From "Voyage dans la Lune" by Georges Melies (1902):
801805
802− #+CAPTION: lalune
803− [[file:lalune.jpg]]
806+#+CAPTION: lalune
807+[[file:lalune.jpg]]
804808
805− Here is a movie [[file:movie.jpg]] icon.
809+Here is a movie [[file:movie.jpg]] icon.
806810
807− --------------
811+--------------
808812
809813* Footnotes
810814 :PROPERTIES:
811815 :CUSTOM_ID: footnotes
812816 :END:
813817
814− Here is a footnote reference,[fn:1] and another.[fn:2] This should /not/ be
815− a footnote reference, because it contains a space.[\^my note] Here is an
816− inline note.[fn:3]
818+Here is a footnote reference,[fn:1] and another.[fn:2] This should /not/ be a
819+footnote reference, because it contains a space.[\^my note] Here is an inline
820+note.[fn:3]
817821
818− #+BEGIN_QUOTE
819− Notes can go in quotes.[fn:4]
820− #+END_QUOTE
822+#+BEGIN_QUOTE
823+ Notes can go in quotes.[fn:4]
824+#+END_QUOTE
821825
822− 1. And in list items.[fn:5]
826+1. And in list items.[fn:5]
823827
824− This paragraph should not be part of the note, as it is not indented.
828+This paragraph should not be part of the note, as it is not indented.
825829
826830[fn:1] Here is the footnote. It can go anywhere after the footnote reference.
827831 It need not be placed at the end of the document.