Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New markdown to asciidoc tests #5716

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions test/command/markdown-to-asciidoc-code.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
converted from: <https://github.com/bodiam/markdown-to-asciidoc/tree/9bd90bc405a7d25b03822cc91154bcb315ab39bf/src/test/resources/nl/jworks/markdown_to_asciidoc/code.feature>

Render a code block without language

% pandoc -t asciidoc
```
summary(cars$dist)
summary(cars$speed)
```
^D
....
summary(cars$dist)
summary(cars$speed)
....


Render a code block without language containing HTML

% pandoc -t asciidoc
```
No language indicated, so no syntax highlighting.
But let's throw in a <b>tag</b>.
```
^D
....
No language indicated, so no syntax highlighting.
But let's throw in a <b>tag</b>.
....


Render a javascript code block

% pandoc -t asciidoc
```javascript
var s = "JavaScript syntax highlighting";
alert(s);
```
^D
[source,javascript]
----
var s = "JavaScript syntax highlighting";
alert(s);
----


Render a python code block

% pandoc -t asciidoc
```python
s = "Python syntax highlighting"
print s
```
^D
[source,python]
----
s = "Python syntax highlighting"
print s
----


Render code block adjacent to preceding paragraph

% pandoc -t asciidoc
An example:

```javascript
var s = "JavaScript syntax highlighting";
alert(s);
```
^D
An example:

[source,javascript]
----
var s = "JavaScript syntax highlighting";
alert(s);
----


Render inline code

% pandoc -t asciidoc
We defined the `add` function to
^D
We defined the `+add+` function to

33 changes: 33 additions & 0 deletions test/command/markdown-to-asciidoc-description-lists.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
converted from: <https://github.com/bodiam/markdown-to-asciidoc/tree/9bd90bc405a7d25b03822cc91154bcb315ab39bf/src/test/resources/nl/jworks/markdown_to_asciidoc/descriptionlists.feature>

Render a description list

```
% pandoc -t asciidoc
Apple
: Pomaceous fruit of plants of the genus Malus in
the family Rosaceae.
^D
Apple::
Pomaceous fruit of plants of the genus Malus in the family Rosaceae.
```


Render a multiple description lists

```
% pandoc -t asciidoc
Apple
: Pomaceous fruit of plants of the genus Malus in
the family Rosaceae.

Orange
: The fruit of an evergreen tree of the genus Citrus.
^D
Apple::
Pomaceous fruit of plants of the genus Malus in the family Rosaceae.
Orange::
The fruit of an evergreen tree of the genus Citrus.
```


94 changes: 94 additions & 0 deletions test/command/markdown-to-asciidoc-headings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
converted from: <https://github.com/bodiam/markdown-to-asciidoc/tree/9bd90bc405a7d25b03822cc91154bcb315ab39bf/src/test/resources/nl/jworks/markdown_to_asciidoc/headings.feature>

Render a level 1 heading

```
% pandoc -t asciidoc
# Title #
^D
= Title
```


Render a level 1 underscored heading

```
% pandoc -t asciidoc
Title
=====
^D
= Title
```


Render a level 2 heading

```
% pandoc -t asciidoc
## Title
^D
== Title
```


Render a level 2 underscored heading

```
% pandoc -t asciidoc
Title
-----
^D
== Title
```


Render a level 3 heading

```
% pandoc -t asciidoc
## Title
Copy link
Contributor

@cagix cagix Aug 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this read "### Title" ...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe :) We should probably implement #5615

Copy link
Contributor

@cagix cagix Sep 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm, beside the discussion in #5615, the comment for this test case (line 45 "Render a level 3 heading") does not match the actual test data in lines 49 to 51, as it is just a level 2 heading (which is tested also in lines 24 .. 31 above).

^D
== Title
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... and accordingly "=== Title" here?

```


Render a level 4 heading

```
% pandoc -t asciidoc
#### Title
^D
==== Title
```


Render a level 5 heading

```
% pandoc -t asciidoc
##### Title
^D
===== Title
```


Render a level 6 heading

```
% pandoc -t asciidoc
###### Title
^D
====== Title
```


Render a heading with different styling

```
% pandoc -t asciidoc
# Title ####
^D
= Title
```


21 changes: 21 additions & 0 deletions test/command/markdown-to-asciidoc-lines.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
converted from: <https://github.com/bodiam/markdown-to-asciidoc/tree/9bd90bc405a7d25b03822cc91154bcb315ab39bf/src/test/resources/nl/jworks/markdown_to_asciidoc/lines.feature>

Create 4 horizontal lines

```
% pandoc -t asciidoc
---

- - -

***

* * *
^D
'''
'''
'''
'''
```


123 changes: 123 additions & 0 deletions test/command/markdown-to-asciidoc-links.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
converted from: <https://github.com/bodiam/markdown-to-asciidoc/tree/9bd90bc405a7d25b03822cc91154bcb315ab39bf/src/test/resources/nl/jworks/markdown_to_asciidoc/links.feature>

Render an implicit inline link

```
% pandoc -t asciidoc
Use [http://example.com](http://example.com) for sample links in documentation.
^D
Use http://example.com for sample links in documentation.
```


Render an inline link

```
% pandoc -t asciidoc
This is [an example](http://example.com/) inline link.
^D
This is http://example.com/[an example] inline link.
```


Render linked text with comma

```
% pandoc -t asciidoc
This is [a very, very cool](http://example.com/) inline link.
^D
This is http://example.com/[a very, very cool] inline link.
```


Render a reference style link with link definition

```
% pandoc -t asciidoc
The [syntax page][s] provides complete, detailed documentation for

[s]: /projects/markdown/syntax "Markdown Syntax"
^D
The link:/projects/markdown/syntax[syntax page] provides complete,
detailed documentation for
```


Render a reference style link with link text

```
% pandoc -t asciidoc
The [syntax page] provides documentation

[syntax page]: http://www.syntaxpage.com
^D
The http://www.syntaxpage.com[syntax page] provides documentation
```


Render an internal link

```
% pandoc -t asciidoc
Refer to [Quick start](#quick-start) to learn how to get started.
^D
Refer to link:#quick-start[Quick start] to learn how to get started.
```


Render an reference style image

```
% pandoc -t asciidoc
![Alt text][logo]

[logo]: images/icons/home.png
^D
image:images/icons/home.png[Alt text]
```


Render an inline image with parameters

```
% pandoc -t asciidoc
![Alt text](images/icons/home.png)

![Alt text](images/icons/home.png?width=100)
^D
image:images/icons/home.png[Alt text]

image:images/icons/home.png?width=100[Alt text]
```


Render an inline image with comma in alt text

```
% pandoc -t asciidoc
![Alt,text](images/icons/home.png)
^D
image:images/icons/home.png["Alt,text"]
```


Render a hyperlinked inline image with alt text

```
% pandoc -t asciidoc
[![Build Status](https://travis-ci.org/asciidoctor/asciidoctor.png)](https://travis-ci.org/asciidoctor/asciidoctor)
^D
image:https://travis-ci.org/asciidoctor/asciidoctor.png[Build Status,link=https://travis-ci.org/asciidoctor/asciidoctor]
```


Render a hyperlinked inline image with no alt text

```
% pandoc -t asciidoc
[![](https://travis-ci.org/asciidoctor/asciidoctor.png)](https://travis-ci.org/asciidoctor/asciidoctor)
^D
image:https://travis-ci.org/asciidoctor/asciidoctor.png[link=https://travis-ci.org/asciidoctor/asciidoctor]
```


Loading