Skip to content

Demo

this is sample document

title and table of content

markdown

# this is sample document
<!-- word toc 3 "toc caption" -->

The result is above. # is for the document title.

The table of contents above is to level 3 and the caption is toc caption

This sample markdown is modified from the document of markdown-it.

Heading

markdown

### Heading2
#### Heading3
##### Heading4
###### Heading5

result

Heading2

Heading3

Heading4
Heading5

Horizontal Rules

markdown

___
---
***

Horizontal Rules does not work.

BR

markdown

next line is `<br>`
test<BR>
<BR>
upper line is `<br>`

result

next line is <br>

test


upper line is <br>

new page

markdown

next line is `<!-- word newPage -->`
<!-- word newPage -->
upper line is `<!-- word newPage -->`

result

next line is <!-- word newPage -->

upper line is <!-- word newPage -->

Typographic replacements

NOTE: All @ are replaced to ”\@” in markdown to docx.

anonymous@com.com

Emphasis

markdown

**This is bold text**
**This is bold text**
_This is italic text_
_This is italic text_
~~Strikethrough~~
2<sup>x</sup><sub>y</sub>

result

This is bold text

This is bold text

This is italic text

This is italic text

Strikethrough

2xy

Emphasis2

markdown

**This is bold text**
**This is bold text**
_This is italic text_
_This is italic text_
~~Strikethrough~~
2<sup>x</sup><sub>y</sub>

result

This is bold text This is bold text This is italic text This is italic text Strikethrough 2xy

NOTE: Sometime Emphasis does not work. That time, please add some spaces between words.

Blockquotes

NOTE: markdown to docx does not support blockquote.

markdown

> Blockquotes can also be nested...
>
> > ...by using additional greater-than *signs* _right_ next to each other...
> >
> > * eeeeeeeee
> > > ...or with spaces between arrows.

result

Blockquotes can also be nested…

…by using additional greater-than signs right next to each other…

  • eeeeeeeee

…or with spaces between arrows.

Lists Unordered

NOTE: markdown to docx supports only three layers.

markdown

- Create a list by starting a line with `+`, `-`, or `*`
- Sub-lists are made by indenting 2 spaces:
- Marker character change forces new list start:
- Ac tristique libero volutpat at
* Facilisis in pretium nisl aliquet
- Nulla volutpat aliquam velit
- Very easy!
* look me [](#links) send you

result

  • Create a list by starting a line with +, -, or *
  • Sub-lists are made by indenting 2 spaces:
    • Marker character change forces new list start:
      • Ac tristique libero volutpat at
      • Facilisis in pretium nisl aliquet
      • Nulla volutpat aliquam velit
  • Very easy!
  • look me send you

Lists ordered

markdown

1. Lorem ipsum dolor sit amet
2. Consectetur adipiscing elit
3. Integer molestie lorem at massa
4. You can use sequential numbers...
5. ...or keep all the numbers as `1.`
NOTE: **markdown to docx** does not support numbering with offset:
57. foo
1. bar

result

  1. Lorem ipsum dolor sit amet fffffa2xyaffff

  2. Consectetur adipiscing elit

  3. Integer molestie lorem at massa

  4. You can use sequential numbers…

  5. …or keep all the numbers as 1.

NOTE: markdown to docx does not support numbering with offset:

  1. foo
  2. bar

Lists mixed

markdown

1. ordered1
- unordered2
1. ordered3

result

  1. ordered1
    • unordered2
      1. ordered3

Code

markdown

Inline `code`

result

Inline code

Indented code

markdown

// Some comments
line 1 of code
line 2 of code
line 3 of code

result

// Some comments
line 1 of code
line 2 of code
line 3 of code

Block code syntax highlighting

NOTE: markdown to docx does not support Syntax highlighting.

var foo = function (bar) {
return bar++;
};
console.log(foo(5));

Tables

normal table

markdown

| data1-1 | data1-2 |
| ------- | ----------------------- |
| data2-1 | data2-2 |
| data3-1 | data3-2 |
| data4-1 | data4-2 |

result

data1-1data1-2
data2-1data2-2
data3-1data3-2
data4-1data4-2

merge cells No.1

  • cell(3,1) and cell(4,2) are merged.

markdown

<!-- word tableParam emptyMerge On -->
| data1-1 | data1-2 |
| ------- | ----------------------- |
| data2-1 | data2-2 |
| | data3-2 |
| data4-1 | |

result

data1-1data1-2
data2-1data2-2
data3-2
data4-1

merge cells No.2

markdown

<!-- word tableParam emptyMerge On -->
cell(4,2) is not merged. (comment cell)
| data1-1 | data1-2 |
| ------- | ----------------------- |
| data2-1 | data2-2 |
| | data3-2 |
| data4-1 | <!-- not merged --> |

result

tableParam

cell(4,2) is not merged. (comment cell)

data1-1data1-2
data2-1data2-2
data3-2
data4-1

table with emphasis

markdown

| data1-1 | data1-2 |
| ------- | -------------------- --- |
| data2-1 | _This is italic text_ |
| | 2<sup>x</sup><sub>y</sub> |
| data4-1 | **This is bold text** |

result

data1-1data1-2
data2-1This is italic text
2xy
data4-1This is bold text

table column width

markdown

<!-- word tableParam cols 2,1 -->
<!-- word tableParam emptyMerge On -->
| data1-1 | data1-2 |
| ------- | ----------------------- |
| data2-1 | data2-2 |
| data3-1 | data3-2 |
| data4-1 | data4-2 |

result

data1-1data1-2
data2-1data2-2
data3-1data3-2
data4-1data4-2

Right aligned and rows merge

markdown

<!-- word tableParam cols 1,3 -->
<!-- word tableParam rowMerge 3-4 -->
| data1-1 | data1-2 |
| -------:| -----------------------:|
| data2-1 | data2-2 XXXXX |
| data3-1 | data3-2 |
| data4-1 | data4-2 |

result

data1-1data1-2
data2-1data2-2 XXXXX
data3-1data3-2
data4-1data4-2

NOTE: aligned is not worked

table with new line

markdown

| data1-1 | data1-2 |
| ------- | ----------------------- |
| data2-1 | data2-2 |
| data3-1 | data3-2<bR>data3-2-2 |
| data4-1 | data4-2 |

result

data1-1data1-2
data2-1data2-2
data3-1data3-2
data3-2-2
data4-1data4-2

NOTE: does not work

cross reference in a docx

markdown

### refs1
### refs2 with space
* look me [refs1](#refs1) send you
* look me [refs2 with space](#refs2-with-space) send you

result

refs1

refs2 with space

look you [link text](http://dev.nodeca.com) see me
Jason Campbell <jasoncampbell@google.com> (http://twitter.com/jxson)
* [link with title](http://nodeca.github.io/pica/demo/ "title text!")
* Autoconverted link https://github.com/nodeca/pica (enable linkify to see)

look you link text see me

Jason Campbell jasoncampbell@google.com (http://twitter.com/jxson)

Images

markdown

![logo](./markdown2docx.png)
This extension logo is ![logo](./markdown2docx.png) .

result

sorry no image.

NOTE: markdown to docx supports only image files.

NOTE: Inline images do not work well.

Math

markdown

This sentence uses dollar sign delimiters to show math inline: $\sqrt{3x-1}+(1+x)^2$ `$\sqrt{3x-1}+(1+x)^2$`
$\sqrt{3x-1}+(1+x)^2$

result

This sentence uses dollar sign delimiters to show math inline: $\sqrt{3x-1}+(1+x)^2$ $\sqrt{3x-1}+(1+x)^2$

$\sqrt{3x-1}+(1+x)^2$

NOTE: math works so so.

Admonition

markdown

NOTE: admonition note.
WARNING: admonition warning.

result

NOTE: admonition note.

WARNING: admonition warning.