├── cmd ├── run.sh ├── chinese.pdf ├── md2pdf │ ├── test.pdf │ ├── russian.pdf │ ├── helvetica_1251.z │ ├── test.md │ ├── helvetica_1251.json │ ├── russian.md │ ├── cp1251.map │ └── md2pdf.go ├── russian_test.pdf ├── test_syntax_highlighting.pdf ├── run_syntax_highlighting.sh ├── test_syntax_highlighting.md ├── russian_test.md └── chinese.md ├── testdata ├── Nested blockquotes.text ├── Tabs.pdf ├── Image.pdf ├── Tables.pdf ├── syntax.pdf ├── Tidyness.pdf ├── Auto links.pdf ├── Code Blocks.pdf ├── Code Spans.pdf ├── Horizontal rules.pdf ├── Backslash escapes.pdf ├── Links, inline style.pdf ├── Nested blockquotes.pdf ├── syntax_highlighting.pdf ├── Inline HTML (Simple).pdf ├── Inline HTML comments.pdf ├── Tidyness.text ├── Amps and angle encoding.pdf ├── Inline HTML (Advanced).pdf ├── Links, reference style.pdf ├── Literal quotes in titles.pdf ├── Strong and em together.pdf ├── Links, shortcut references.pdf ├── Blockquotes with code blocks.pdf ├── Ordered and unordered lists.pdf ├── Markdown Documentation - Basics.pdf ├── Hard-wrapped paragraphs with list-like lines.pdf ├── Nested blockquotes.html ├── Strong and em together.text ├── Literal quotes in titles.text ├── Tidyness.html ├── Literal quotes in titles.html ├── Code Spans.text ├── Hard-wrapped paragraphs with list-like lines no empty line before block.pdf ├── Inline HTML (Advanced).text ├── Inline HTML comments.text ├── Code Spans.html ├── Inline HTML (Advanced).html ├── Strong and em together.html ├── Hard-wrapped paragraphs with list-like lines.text ├── Inline HTML comments.html ├── Hard-wrapped paragraphs with list-like lines.html ├── Blockquotes with code blocks.html ├── Hard-wrapped paragraphs with list-like lines no empty line before block.text ├── Links, inline style.text ├── Links, shortcut references.html ├── Auto links.text ├── Blockquotes with code blocks.text ├── Links, shortcut references.text ├── Hard-wrapped paragraphs with list-like lines no empty line before block.html ├── Code Blocks.html ├── Code Blocks.text ├── Tabs.md ├── Links, inline style.html ├── Tabs.text ├── Amps and angle encoding.text ├── Tabs.html ├── Amps and angle encoding.html ├── Horizontal rules.text ├── Auto links.html ├── Horizontal rules.html ├── Hard-wrapped paragraphs with list-like lines.log ├── Hard-wrapped paragraphs with list-like lines no empty line before block.log ├── Literal quotes in titles.log ├── Blockquotes with code blocks.log ├── Inline HTML (Advanced).log ├── Inline HTML (Simple).text ├── Tables.text ├── Nested blockquotes.log ├── Inline HTML (Simple).html ├── Inline HTML comments.log ├── Links, reference style.text ├── Code Blocks.log ├── Code Spans.log ├── Links, reference style.html ├── Strong and em together.log ├── Image.text ├── Links, shortcut references.log ├── Backslash escapes.text ├── Ordered and unordered lists.md ├── Links, inline style.log ├── Backslash escapes.html ├── Tidyness.log ├── Ordered and unordered lists.html ├── Tabs.log ├── Amps and angle encoding.log ├── Inline HTML (Simple).log ├── Horizontal rules.log ├── Auto links.log ├── syntax_highlighting.md ├── Tables.log ├── Image.log ├── Links, reference style.log ├── Markdown Documentation - Basics.text ├── Markdown Documentation - Basics.html └── Backslash escapes.log ├── image ├── bay.jpg ├── fpdf.png └── hiking.png ├── .gitmodules ├── .gitignore ├── .pre-commit-config.yaml ├── .github ├── ISSUE_TEMPLATE │ └── bug_report.md └── workflows │ ├── go.yml │ └── release.yml ├── go.mod ├── LICENSE ├── doc.go ├── containers.go ├── .goreleaser.yaml ├── go.sum ├── md2pdf.1.md ├── custom_themes ├── dark_theme.json └── light_theme.json ├── mdtopdf_test.go ├── README.md └── colors.go /cmd/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | go run convert.go -i test.md -o test.pdf -------------------------------------------------------------------------------- /testdata/Nested blockquotes.text: -------------------------------------------------------------------------------- 1 | > foo 2 | > 3 | > > bar 4 | > 5 | > foo 6 | -------------------------------------------------------------------------------- /image/bay.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solworktech/md2pdf/HEAD/image/bay.jpg -------------------------------------------------------------------------------- /image/fpdf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solworktech/md2pdf/HEAD/image/fpdf.png -------------------------------------------------------------------------------- /cmd/chinese.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solworktech/md2pdf/HEAD/cmd/chinese.pdf -------------------------------------------------------------------------------- /image/hiking.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solworktech/md2pdf/HEAD/image/hiking.png -------------------------------------------------------------------------------- /testdata/Tabs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solworktech/md2pdf/HEAD/testdata/Tabs.pdf -------------------------------------------------------------------------------- /cmd/md2pdf/test.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solworktech/md2pdf/HEAD/cmd/md2pdf/test.pdf -------------------------------------------------------------------------------- /testdata/Image.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solworktech/md2pdf/HEAD/testdata/Image.pdf -------------------------------------------------------------------------------- /testdata/Tables.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solworktech/md2pdf/HEAD/testdata/Tables.pdf -------------------------------------------------------------------------------- /testdata/syntax.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solworktech/md2pdf/HEAD/testdata/syntax.pdf -------------------------------------------------------------------------------- /cmd/md2pdf/russian.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solworktech/md2pdf/HEAD/cmd/md2pdf/russian.pdf -------------------------------------------------------------------------------- /cmd/russian_test.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solworktech/md2pdf/HEAD/cmd/russian_test.pdf -------------------------------------------------------------------------------- /testdata/Tidyness.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solworktech/md2pdf/HEAD/testdata/Tidyness.pdf -------------------------------------------------------------------------------- /testdata/Auto links.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solworktech/md2pdf/HEAD/testdata/Auto links.pdf -------------------------------------------------------------------------------- /testdata/Code Blocks.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solworktech/md2pdf/HEAD/testdata/Code Blocks.pdf -------------------------------------------------------------------------------- /testdata/Code Spans.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solworktech/md2pdf/HEAD/testdata/Code Spans.pdf -------------------------------------------------------------------------------- /cmd/md2pdf/helvetica_1251.z: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solworktech/md2pdf/HEAD/cmd/md2pdf/helvetica_1251.z -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "highlight"] 2 | path = highlight 3 | url = https://github.com/jessp01/gohighlight 4 | -------------------------------------------------------------------------------- /testdata/Horizontal rules.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solworktech/md2pdf/HEAD/testdata/Horizontal rules.pdf -------------------------------------------------------------------------------- /cmd/test_syntax_highlighting.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solworktech/md2pdf/HEAD/cmd/test_syntax_highlighting.pdf -------------------------------------------------------------------------------- /testdata/Backslash escapes.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solworktech/md2pdf/HEAD/testdata/Backslash escapes.pdf -------------------------------------------------------------------------------- /testdata/Links, inline style.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solworktech/md2pdf/HEAD/testdata/Links, inline style.pdf -------------------------------------------------------------------------------- /testdata/Nested blockquotes.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solworktech/md2pdf/HEAD/testdata/Nested blockquotes.pdf -------------------------------------------------------------------------------- /testdata/syntax_highlighting.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solworktech/md2pdf/HEAD/testdata/syntax_highlighting.pdf -------------------------------------------------------------------------------- /testdata/Inline HTML (Simple).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solworktech/md2pdf/HEAD/testdata/Inline HTML (Simple).pdf -------------------------------------------------------------------------------- /testdata/Inline HTML comments.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solworktech/md2pdf/HEAD/testdata/Inline HTML comments.pdf -------------------------------------------------------------------------------- /testdata/Tidyness.text: -------------------------------------------------------------------------------- 1 | > A list within a blockquote: 2 | > 3 | > * asterisk 1 4 | > * asterisk 2 5 | > * asterisk 3 6 | -------------------------------------------------------------------------------- /testdata/Amps and angle encoding.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solworktech/md2pdf/HEAD/testdata/Amps and angle encoding.pdf -------------------------------------------------------------------------------- /testdata/Inline HTML (Advanced).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solworktech/md2pdf/HEAD/testdata/Inline HTML (Advanced).pdf -------------------------------------------------------------------------------- /testdata/Links, reference style.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solworktech/md2pdf/HEAD/testdata/Links, reference style.pdf -------------------------------------------------------------------------------- /testdata/Literal quotes in titles.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solworktech/md2pdf/HEAD/testdata/Literal quotes in titles.pdf -------------------------------------------------------------------------------- /testdata/Strong and em together.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solworktech/md2pdf/HEAD/testdata/Strong and em together.pdf -------------------------------------------------------------------------------- /testdata/Links, shortcut references.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solworktech/md2pdf/HEAD/testdata/Links, shortcut references.pdf -------------------------------------------------------------------------------- /testdata/Blockquotes with code blocks.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solworktech/md2pdf/HEAD/testdata/Blockquotes with code blocks.pdf -------------------------------------------------------------------------------- /testdata/Ordered and unordered lists.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solworktech/md2pdf/HEAD/testdata/Ordered and unordered lists.pdf -------------------------------------------------------------------------------- /testdata/Markdown Documentation - Basics.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solworktech/md2pdf/HEAD/testdata/Markdown Documentation - Basics.pdf -------------------------------------------------------------------------------- /testdata/Hard-wrapped paragraphs with list-like lines.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solworktech/md2pdf/HEAD/testdata/Hard-wrapped paragraphs with list-like lines.pdf -------------------------------------------------------------------------------- /testdata/Nested blockquotes.html: -------------------------------------------------------------------------------- 1 |
2 |10 | -------------------------------------------------------------------------------- /testdata/Strong and em together.text: -------------------------------------------------------------------------------- 1 | ***This is strong and em.*** 2 | 3 | So is ***this*** word. 4 | 5 | ___This is strong and em.___ 6 | 7 | So is ___this___ word. 8 | -------------------------------------------------------------------------------- /testdata/Literal quotes in titles.text: -------------------------------------------------------------------------------- 1 | Foo [bar][]. 2 | 3 | Foo [bar](/url/ "Title with "quotes" inside"). 4 | 5 | 6 | [bar]: /url/ "Title with "quotes" inside" 7 | 8 | -------------------------------------------------------------------------------- /cmd/run_syntax_highlighting.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd md2pdf || exit 3 | go run md2pdf.go -i test_syntax_highlighting.md -o test_syntax_highlighting.pdf -s ../gohighlight/syntax_files 4 | -------------------------------------------------------------------------------- /testdata/Tidyness.html: -------------------------------------------------------------------------------- 1 |foo
3 | 4 |5 |7 | 8 |bar
6 |foo
9 |
2 |10 | -------------------------------------------------------------------------------- /testdata/Literal quotes in titles.html: -------------------------------------------------------------------------------- 1 |A list within a blockquote:
3 | 4 |5 |
9 |- asterisk 1
6 |- asterisk 2
7 |- asterisk 3
8 |
Foo bar.
2 | 3 |Foo bar.
4 | -------------------------------------------------------------------------------- /testdata/Code Spans.text: -------------------------------------------------------------------------------- 1 | `<test a=" content of attribute ">
Fix for backticks within HTML tag: like this
4 | 5 |Here's how you put `backticks` in a code span.
Simple block on one line:
2 | 3 |And nested without indentation:
6 | 7 |This is strong and em.
2 | 3 |So is this word.
4 | 5 |This is strong and em.
6 | 7 |So is this word.
8 | -------------------------------------------------------------------------------- /testdata/Hard-wrapped paragraphs with list-like lines.text: -------------------------------------------------------------------------------- 1 | In Markdown 1.0.0 and earlier. Version 2 | 8. This line turns into a list item. 3 | Because a hard-wrapped line in the 4 | middle of a paragraph looked like a 5 | list item. 6 | 7 | Here's one with a bullet. 8 | * criminey. 9 | -------------------------------------------------------------------------------- /testdata/Inline HTML comments.html: -------------------------------------------------------------------------------- 1 |Paragraph one.
2 | 3 | 4 | 5 | 8 | 9 |Paragraph two.
10 | 11 | 12 | 13 |The end.
14 | -------------------------------------------------------------------------------- /testdata/Hard-wrapped paragraphs with list-like lines.html: -------------------------------------------------------------------------------- 1 |In Markdown 1.0.0 and earlier. Version 2 | 8. This line turns into a list item. 3 | Because a hard-wrapped line in the 4 | middle of a paragraph looked like a 5 | list item.
6 | 7 |Here's one with a bullet. 8 | * criminey.
9 | -------------------------------------------------------------------------------- /testdata/Blockquotes with code blocks.html: -------------------------------------------------------------------------------- 1 |2 |16 | -------------------------------------------------------------------------------- /testdata/Hard-wrapped paragraphs with list-like lines no empty line before block.text: -------------------------------------------------------------------------------- 1 | In Markdown 1.0.0 and earlier. Version 2 | 8. This line turns into a list item. 3 | Because a hard-wrapped line in the 4 | middle of a paragraph looked like a 5 | list item. 6 | 7 | Here's one with a bullet. 8 | * criminey. 9 | -------------------------------------------------------------------------------- /testdata/Links, inline style.text: -------------------------------------------------------------------------------- 1 | Just a [URL](/url/). 2 | 3 | [URL and title](/url/ "title"). 4 | 5 | [URL and title](/url/ "title preceded by two spaces"). 6 | 7 | [URL and title](/url/ "title preceded by a tab"). 8 | 9 | [URL and title](/url/ "title has spaces afterward" ). 10 | 11 | 12 | [Empty](). 13 | -------------------------------------------------------------------------------- /testdata/Links, shortcut references.html: -------------------------------------------------------------------------------- 1 |Example:
3 | 4 |8 | 9 |sub status { 5 | print "working"; 6 | } 7 |Or:
10 | 11 |15 |sub status { 12 | return "working"; 13 | } 14 |
This is the simple case.
2 | 3 |This one has a line 4 | break.
5 | 6 |This one has a line 7 | break with a line-ending space.
8 | 9 | 10 | -------------------------------------------------------------------------------- /testdata/Auto links.text: -------------------------------------------------------------------------------- 1 | Link:In Markdown 1.0.0 and earlier. Version
2 | 3 |Here's one with a bullet.
11 | 12 |code block on the first line
2 |
3 |
4 | Regular text.
5 | 6 |code block indented by spaces
7 |
8 |
9 | Regular text.
10 | 11 |the lines in this block
12 | all contain trailing spaces
13 |
14 |
15 | Regular Text.
16 | 17 |code block on the last line
18 |
19 |
--------------------------------------------------------------------------------
/testdata/Code Blocks.text:
--------------------------------------------------------------------------------
1 | code block on the first line
2 |
3 | Regular text.
4 |
5 | code block indented by spaces
6 |
7 | Regular text.
8 |
9 | the lines in this block
10 | all contain trailing spaces
11 | This one is really, really, really, really, really, really, really, really, really, really, really, really, really, really long
12 |
13 | Regular Text.
14 |
15 | code block on the last line
--------------------------------------------------------------------------------
/testdata/Tabs.md:
--------------------------------------------------------------------------------
1 | + this is a list item
2 | indented with tabs
3 |
4 | + this is a list item
5 | indented with spaces
6 |
7 | Code:
8 |
9 | this code block is indented by one tab
10 |
11 | And:
12 |
13 | this code block is indented by two tabs
14 |
15 | And:
16 |
17 | + this is an example list item
18 | indented with tabs
19 |
20 | + this is an example list item
21 | indented with spaces
22 |
--------------------------------------------------------------------------------
/testdata/Links, inline style.html:
--------------------------------------------------------------------------------
1 | Just a URL.
2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |[Empty]().
12 | -------------------------------------------------------------------------------- /testdata/Tabs.text: -------------------------------------------------------------------------------- 1 | + this is a list item 2 | indented with tabs 3 | 4 | + this is a list item 5 | indented with spaces 6 | 7 | Code: 8 | 9 | this code block is indented by one tab 10 | 11 | And: 12 | 13 | this code block is indented by two tabs 14 | 15 | And: 16 | 17 | + this is an example list item 18 | indented with tabs 19 | 20 | + this is an example list item 21 | indented with spaces 22 | -------------------------------------------------------------------------------- /cmd/russian_test.md: -------------------------------------------------------------------------------- 1 | # Russian Phrases 2 | 3 | - First phrase is: 4 | "Съешь же ещё этих мягких французских булок, да выпей чаю", which means "Eat these soft French rolls and drink some tea" 5 | - The second is: 6 | "Влюбиться можно в красоту, но полюбить – лишь только душу!", which means "You can fall in love with beauty, but love is only a soul!" 7 | - Finally, "Молоко и творог", which means "Milk and cottage cheese" 8 | 9 | That's all folks! 10 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | repos: 3 | - repo: https://github.com/jessp01/pre-commit-golang.git 4 | rev: v0.5.4 5 | hooks: 6 | - id: go-fmt 7 | # - id: go-imports 8 | - id: go-vet 9 | - id: go-lint 10 | - id: go-critic 11 | - id: go-ineffassign 12 | # - repo: https://github.com/crate-ci/typos 13 | # rev: v1.32.0 14 | # hooks: 15 | # - id: typos 16 | # exclude_types: [yaml] 17 | # exclude: go.* 18 | -------------------------------------------------------------------------------- /testdata/Amps and angle encoding.text: -------------------------------------------------------------------------------- 1 | AT&T has an ampersand in their name. 2 | 3 | AT&T is another way to write it. 4 | 5 | This & that. 6 | 7 | 4 < 5. 8 | 9 | 6 > 5. 10 | 11 | Here's a [link] [1] with an ampersand in the URL. 12 | 13 | Here's a link with an amersand in the link text: [AT&T] [2]. 14 | 15 | Here's an inline [link](/script?foo=1&bar=2). 16 | 17 | Here's an inline [link](). 18 | 19 | 20 | [1]: http://example.com/?foo=1&bar=2 21 | [2]: http://att.com/ "AT&T" -------------------------------------------------------------------------------- /testdata/Tabs.html: -------------------------------------------------------------------------------- 1 |this is a list item 3 | indented with tabs
this is a list item 6 | indented with spaces
Code:
10 | 11 |this code block is indented by one tab
12 |
13 |
14 | And:
15 | 16 | this code block is indented by two tabs
17 |
18 |
19 | And:
20 | 21 |+ this is an example list item
22 | indented with tabs
23 |
24 | + this is an example list item
25 | indented with spaces
26 |
27 |
--------------------------------------------------------------------------------
/testdata/Amps and angle encoding.html:
--------------------------------------------------------------------------------
1 | AT&T has an ampersand in their name.
2 | 3 |AT&T is another way to write it.
4 | 5 |This & that.
6 | 7 |4 < 5.
8 | 9 |6 > 5.
10 | 11 |Here's a link with an ampersand in the URL.
12 | 13 |Here's a link with an amersand in the link text: AT&T.
14 | 15 |Here's an inline link.
16 | 17 |Here's an inline link.
18 | -------------------------------------------------------------------------------- /testdata/Horizontal rules.text: -------------------------------------------------------------------------------- 1 | Dashes: 2 | 3 | --- 4 | 5 | --- 6 | 7 | --- 8 | 9 | --- 10 | 11 | --- 12 | 13 | - - - 14 | 15 | - - - 16 | 17 | - - - 18 | 19 | - - - 20 | 21 | - - - 22 | 23 | 24 | Asterisks: 25 | 26 | *** 27 | 28 | *** 29 | 30 | *** 31 | 32 | *** 33 | 34 | *** 35 | 36 | * * * 37 | 38 | * * * 39 | 40 | * * * 41 | 42 | * * * 43 | 44 | * * * 45 | 46 | 47 | Underscores: 48 | 49 | ___ 50 | 51 | ___ 52 | 53 | ___ 54 | 55 | ___ 56 | 57 | ___ 58 | 59 | _ _ _ 60 | 61 | _ _ _ 62 | 63 | _ _ _ 64 | 65 | _ _ _ 66 | 67 | _ _ _ 68 | -------------------------------------------------------------------------------- /testdata/Auto links.html: -------------------------------------------------------------------------------- 1 |Link: http://example.com/.
2 | 3 |With an ampersand: http://example.com/?foo=1&bar=2
4 | 5 |12 |14 | 15 |Blockquoted: http://example.com/
13 |
Auto-links should not occur here: <http://example.com/>
or here: <http://example.com/>
18 |
19 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Bug description
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 |
12 | md2pdf version:
13 |
14 |
15 | **To Reproduce**
16 | Steps to reproduce the behaviour:
17 |
18 | Full `md2pdf` command (including all args):
19 |
20 | Output:
21 |
22 | [ ] I've attached an input sample (MD file)
23 |
24 | **Expected behavior**
25 | A clear and concise description of what you expected to happen
26 | (unless the above makes it obvious, in which case, you can remove this section).
27 |
--------------------------------------------------------------------------------
/testdata/Horizontal rules.html:
--------------------------------------------------------------------------------
1 | Dashes:
2 | 3 |---
12 |
13 |
14 | - - -
23 |
24 |
25 | Asterisks:
26 | 27 |***
36 |
37 |
38 | * * *
47 |
48 |
49 | Underscores:
50 | 51 |___
60 |
61 |
62 | _ _ _
71 |
72 |
--------------------------------------------------------------------------------
/go.mod:
--------------------------------------------------------------------------------
1 | module github.com/solworktech/md2pdf/v2
2 |
3 | go 1.23.0
4 |
5 | require (
6 | codeberg.org/go-pdf/fpdf v0.11.1
7 | github.com/canhlinh/svg2png v0.0.0-20201124065332-6ba87c82371f
8 | github.com/gabriel-vasile/mimetype v1.4.8
9 | github.com/gomarkdown/markdown v0.0.0-20250311123330-531bef5e742b
10 | github.com/jessp01/gohighlight v0.21.2
11 | github.com/mitchellh/go-wordwrap v1.0.1
12 | golang.org/x/exp v0.0.0-20240707233637-46b078467d37
13 | )
14 |
15 | require (
16 | github.com/mcuadros/go-version v0.0.0-20190830083331-035f6764e8d2 // indirect
17 | github.com/sirupsen/logrus v1.9.3 // indirect
18 | github.com/stretchr/testify v1.8.4 // indirect
19 | golang.org/x/net v0.38.0 // indirect
20 | golang.org/x/sys v0.31.0 // indirect
21 | gopkg.in/yaml.v2 v2.4.0 // indirect
22 | )
23 |
--------------------------------------------------------------------------------
/testdata/Hard-wrapped paragraphs with list-like lines.log:
--------------------------------------------------------------------------------
1 | [RenderHeader] Not handled
2 | [Document] Not Handled
3 | [Paragraph (entering)]
4 | [... Margins (left, top, right, bottom:] 28.35 28.35 28.35 56.7
5 | [cr()] LH=14
6 | [Text] 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.
7 | [Paragraph (leaving)]
8 | [... Margins (left, top, right, bottom:] 28.35 28.35 28.35 56.7
9 | [cr()] LH=14
10 | [Paragraph (entering)]
11 | [... Margins (left, top, right, bottom:] 28.35 28.35 28.35 56.7
12 | [cr()] LH=14
13 | [Text] Here's one with a bullet. * criminey.
14 | [Paragraph (leaving)]
15 | [... Margins (left, top, right, bottom:] 28.35 28.35 28.35 56.7
16 | [cr()] LH=14
17 | [Document] Not Handled
18 |
--------------------------------------------------------------------------------
/testdata/Hard-wrapped paragraphs with list-like lines no empty line before block.log:
--------------------------------------------------------------------------------
1 | [RenderHeader] Not handled
2 | [Document] Not Handled
3 | [Paragraph (entering)]
4 | [... Margins (left, top, right, bottom:] 28.35 28.35 28.35 56.7
5 | [cr()] LH=14
6 | [Text] 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.
7 | [Paragraph (leaving)]
8 | [... Margins (left, top, right, bottom:] 28.35 28.35 28.35 56.7
9 | [cr()] LH=14
10 | [Paragraph (entering)]
11 | [... Margins (left, top, right, bottom:] 28.35 28.35 28.35 56.7
12 | [cr()] LH=14
13 | [Text] Here's one with a bullet. * criminey.
14 | [Paragraph (leaving)]
15 | [... Margins (left, top, right, bottom:] 28.35 28.35 28.35 56.7
16 | [cr()] LH=14
17 | [Document] Not Handled
18 |
--------------------------------------------------------------------------------
/testdata/Literal quotes in titles.log:
--------------------------------------------------------------------------------
1 | [RenderHeader] Not handled
2 | [Document] Not Handled
3 | [Paragraph (entering)]
4 | [... Margins (left, top, right, bottom:] 28.35 28.35 28.35 56.7
5 | [cr()] LH=14
6 | [Text] Foo
7 | -[Link (entering)] Destination[/url/] Title[Title with "quotes" inside]
8 | -[Text] bar
9 | -[Link (leaving)]
10 | [Text] .
11 | [Paragraph (leaving)]
12 | [... Margins (left, top, right, bottom:] 28.35 28.35 28.35 56.7
13 | [cr()] LH=14
14 | [Paragraph (entering)]
15 | [... Margins (left, top, right, bottom:] 28.35 28.35 28.35 56.7
16 | [cr()] LH=14
17 | [Text] Foo
18 | -[Link (entering)] Destination[/url/] Title[Title with "quotes" inside]
19 | -[Text] bar
20 | -[Link (leaving)]
21 | [Text] .
22 | [Paragraph (leaving)]
23 | [... Margins (left, top, right, bottom:] 28.35 28.35 28.35 56.7
24 | [cr()] LH=14
25 | [Document] Not Handled
26 |
--------------------------------------------------------------------------------
/testdata/Blockquotes with code blocks.log:
--------------------------------------------------------------------------------
1 | [RenderHeader] Not handled
2 | [Document] Not Handled
3 | [BlockQuote (entering)]
4 | -[Paragraph (entering)]
5 | -[... Margins (left, top, right, bottom:] 58.338 28.35 28.35 56.7
6 | -[cr()] LH=14
7 | -[Text] Example:
8 | -[Paragraph (leaving)]
9 | -[... Margins (left, top, right, bottom:] 58.338 28.35 28.35 56.7
10 | -[cr()] LH=14
11 | -[Codeblock] Leaf 'sub status {\n print "working";\n}\n'
12 |
13 | -[cr()] LH=14
14 | -[Paragraph (entering)]
15 | -[... Margins (left, top, right, bottom:] 58.338 28.35 28.35 56.7
16 | -[cr()] LH=14
17 | -[Text] Or:
18 | -[Paragraph (leaving)]
19 | -[... Margins (left, top, right, bottom:] 58.338 28.35 28.35 56.7
20 | -[cr()] LH=14
21 | -[Codeblock] Leaf 'sub status {\n return "working";\n…'
22 |
23 | -[cr()] LH=14
24 | -[BlockQuote (leaving)]
25 | [cr()] LH=14
26 | [Document] Not Handled
27 |
--------------------------------------------------------------------------------
/testdata/Inline HTML (Advanced).log:
--------------------------------------------------------------------------------
1 | [RenderHeader] Not handled
2 | [Document] Not Handled
3 | [Paragraph (entering)]
4 | [... Margins (left, top, right, bottom:] 28.35 28.35 28.35 56.7
5 | [cr()] LH=14
6 | [Text] Simple block on one line:
7 | [Paragraph (leaving)]
8 | [... Margins (left, top, right, bottom:] 28.35 28.35 28.35 56.7
9 | [cr()] LH=14
10 | [HTMLBlock] Here's a simple block:
2 | 3 |This should be a code block, though:
8 | 9 |<div>
10 | foo
11 | </div>
12 |
13 |
14 | As should this:
15 | 16 |<div>foo</div>
17 |
18 |
19 | Now, nested:
20 | 21 |This should just be an HTML comment:
30 | 31 | 32 | 33 |Multiline:
34 | 35 | 39 | 40 |Code block:
41 | 42 |<!-- Comment -->
43 |
44 |
45 | Just plain comment, with trailing spaces on the line:
46 | 47 | 48 | 49 |Code:
50 | 51 |<hr />
52 |
53 |
54 | Hr's:
55 | 56 |Foo bar.
2 | 3 |Foo bar.
4 | 5 |Foo bar.
6 | 7 |With embedded [brackets].
8 | 9 |Indented once.
10 | 11 |Indented twice.
12 | 13 |Indented thrice.
14 | 15 |Indented [four][] times.
16 | 17 |[four]: /url
18 |
19 |
20 | this should work
23 | 24 |So should this.
25 | 26 |And this.
27 | 28 |And this.
29 | 30 |And this.
31 | 32 |But not [that] [].
33 | 34 |Nor [that][].
35 | 36 |Nor [that].
37 | 38 |[Something in brackets like this should work]
39 | 40 |[Same with this.]
41 | 42 |In this case, this points to something else.
43 | 44 |Backslashing should suppress [this] and [this].
45 | 46 |Here's one where the link 49 | breaks across lines.
50 | 51 |Here's another where the link 52 | breaks across lines, but with a line-ending space.
53 | -------------------------------------------------------------------------------- /cmd/chinese.md: -------------------------------------------------------------------------------- 1 | # 标题一 2 | 这是一个带有一些*强调文本*的段落 - 好吗? 3 | 4 | 这是一个无序列表: 5 | 6 | - 这是一个无序列表 7 | - 分项1.a 8 | - 分项1.b 9 | - 这是无序列表中的第二项 10 | - 分项目2.a 11 | - 分项目2.a.i 12 | - 分项目2.a.ii 13 | - 分项目2.b 14 | 15 | 这是一个有序/编号列表: 16 | 17 | 1. 这是一个编号列表 18 | 1. 一个 19 | 1. 两个 20 | 1. 这是编号列表中的第二项 21 | 1. 一个 22 | 1. 两个 23 | 1. A 24 | 1.乙 25 | 1. x 26 | 1. 年 27 | 1.z 28 | 1. 最后编号的项目 29 | 30 | ##标题二 31 | 这是一个带有一些**强调文本**的段落 - 好吗? 32 | 33 | ### 标题三 34 | 这是一个带有___强调文本的段落___ - 好吗? 35 | 36 | #### 标题四 37 | *一点文字* 38 | 39 | #### 标题五 40 | 只是一些普通的文字……没什么特别的 41 | 42 | 这是一个简单的表: 43 | 44 | |标题 |另一个标题 | 45 | |---------|----------------| 46 | |字段 1 |东西| 47 | |领域 2 |别的东西| 48 | |领域 3 |东西| 49 | |领域 4 |别的东西| 50 | |领域 5 |东西| 51 | |字段 6 |别的东西| 52 | 53 | ###### 标题六 54 | 这真的是嵌套得很深。 55 | 56 | 这是一些代码: 57 | `` 58 | 10 REM 老了吧? 59 | 20 REM 是的,太老了! 60 | `` 61 | 文件名是`oldcode.bas`。 62 | 63 | 这三行应该 64 | 只有一个段落,但保留BF 65 | 换行符,必须用空格替换换行符。 66 | 67 | 下面是一个带有内部代码块的块引用。 68 | 69 | > 示例: 70 | > 71 | > 子状态 { 72 | > 打印“工作”; 73 | > } 74 | > 75 | > 或: 76 | > 77 | > 子状态 { 78 | > 返回“工作”; 79 | > } 80 | 81 | 这是 fpdf 徽标(内联): 82 | 83 | 这是一个地鼠: 84 | 85 |  86 | 87 | * Go gopher 由 Renee French 设计。 Gopher 角色设计在知识共享 3.0 署名许可下获得许可。阅读 http://blog.golang.org/gopher 了解更多详情。* 88 | 89 | 90 | __这是文档的最后一行。__ 91 | -------------------------------------------------------------------------------- /testdata/Strong and em together.log: -------------------------------------------------------------------------------- 1 | [RenderHeader] Not handled 2 | [Document] Not Handled 3 | [Paragraph (entering)] 4 | [... Margins (left, top, right, bottom:] 28.35 28.35 28.35 56.7 5 | [cr()] LH=14 6 | [Text] 7 | [Strong (entering)] 8 | [Emph (entering)] 9 | [Text] This is strong and em. 10 | [Emph (leaving)] 11 | [Strong (leaving)] 12 | [Paragraph (leaving)] 13 | [... Margins (left, top, right, bottom:] 28.35 28.35 28.35 56.7 14 | [cr()] LH=14 15 | [Paragraph (entering)] 16 | [... Margins (left, top, right, bottom:] 28.35 28.35 28.35 56.7 17 | [cr()] LH=14 18 | [Text] So is 19 | [Strong (entering)] 20 | [Emph (entering)] 21 | [Text] this 22 | [Emph (leaving)] 23 | [Strong (leaving)] 24 | [Text] word. 25 | [Paragraph (leaving)] 26 | [... Margins (left, top, right, bottom:] 28.35 28.35 28.35 56.7 27 | [cr()] LH=14 28 | [Paragraph (entering)] 29 | [... Margins (left, top, right, bottom:] 28.35 28.35 28.35 56.7 30 | [cr()] LH=14 31 | [Text] 32 | [Strong (entering)] 33 | [Emph (entering)] 34 | [Text] This is strong and em. 35 | [Emph (leaving)] 36 | [Strong (leaving)] 37 | [Paragraph (leaving)] 38 | [... Margins (left, top, right, bottom:] 28.35 28.35 28.35 56.7 39 | [cr()] LH=14 40 | [Paragraph (entering)] 41 | [... Margins (left, top, right, bottom:] 28.35 28.35 28.35 56.7 42 | [cr()] LH=14 43 | [Text] So is 44 | [Strong (entering)] 45 | [Emph (entering)] 46 | [Text] this 47 | [Emph (leaving)] 48 | [Strong (leaving)] 49 | [Text] word. 50 | [Paragraph (leaving)] 51 | [... Margins (left, top, right, bottom:] 28.35 28.35 28.35 56.7 52 | [cr()] LH=14 53 | [Document] Not Handled 54 | -------------------------------------------------------------------------------- /testdata/Image.text: -------------------------------------------------------------------------------- 1 |These should all get escaped:
2 | 3 |Backslash: \
4 | 5 |Backtick: `
6 | 7 |Asterisk: *
8 | 9 |Underscore: _
10 | 11 |Left brace: {
12 | 13 |Right brace: }
14 | 15 |Left bracket: [
16 | 17 |Right bracket: ]
18 | 19 |Left paren: (
20 | 21 |Right paren: )
22 | 23 |Greater-than: >
24 | 25 |Hash: #
26 | 27 |Period: .
28 | 29 |Bang: !
30 | 31 |Plus: +
32 | 33 |Minus: -
34 | 35 |Tilde: ~
36 | 37 |These should not, because they occur within a code block:
38 | 39 |Backslash: \\
40 |
41 | Backtick: \`
42 |
43 | Asterisk: \*
44 |
45 | Underscore: \_
46 |
47 | Left brace: \{
48 |
49 | Right brace: \}
50 |
51 | Left bracket: \[
52 |
53 | Right bracket: \]
54 |
55 | Left paren: \(
56 |
57 | Right paren: \)
58 |
59 | Greater-than: \>
60 |
61 | Hash: \#
62 |
63 | Period: \.
64 |
65 | Bang: \!
66 |
67 | Plus: \+
68 |
69 | Minus: \-
70 |
71 | Tilde: \~
72 |
73 |
74 | Nor should these, which occur in code spans:
75 | 76 |Backslash: \\
Backtick: \`
Asterisk: \*
Underscore: \_
Left brace: \{
Right brace: \}
Left bracket: \[
Right bracket: \]
Left paren: \(
Right paren: \)
Greater-than: \>
Hash: \#
Period: \.
Bang: \!
Plus: \+
Minus: \-
Tilde: \~
These should get escaped, even though they're matching pairs for 111 | other Markdown constructs:
112 | 113 |*asterisks*
114 | 115 |_underscores_
116 | 117 |`backticks`
118 | 119 |This is a code span with a literal backslash-backtick sequence: \`
This is a tag with unescaped backticks bar.
122 | 123 |This is a tag with backslashes bar.
124 | -------------------------------------------------------------------------------- /cmd/md2pdf/russian.md: -------------------------------------------------------------------------------- 1 | # Heading One 2 | Here are lines of Russian: 3 | 4 | - Молоко и творог 5 | - Съешь же ещё этих мягких французских булок, да выпей чаю 6 | 7 | This is a paragraph with some *emphasized text* - OK? 8 | 9 | Here is an unordered list: 10 | 11 | - this is an unordered list 12 | - subitem 1.a 13 | - subitem 1.b 14 | - this is second item in unordered list 15 | - subitem 2.a 16 | - subitem 2.a.i 17 | - subitem 2.a.ii 18 | - subitem 2.b 19 | 20 | Here is an ordered/numbered list: 21 | 22 | 1. This is a numbered list 23 | 1. one 24 | 1. two 25 | 1. This is second item in numbered list 26 | 1. one 27 | 1. two 28 | 1. A 29 | 1. B 30 | 1. x 31 | 1. y 32 | 1. z 33 | 1. last numbered item 34 | 35 | ## Heading Two 36 | This is a paragraph with some **emphasized text** - OK? 37 | 38 | ### Heading Three 39 | This is a paragraph with some ___emphasized text___ - OK? 40 | 41 | #### Heading Four 42 | *A wee bit of text* 43 | 44 | #### Heading Five 45 | Just some normal text... nothing fancy 46 | 47 | This is a simple table: 48 | 49 | | Header | Another header | 50 | |---------|----------------| 51 | | field 1 | something | 52 | | field 2 | something else | 53 | | field 3 | something | 54 | | field 4 | something else | 55 | | field 5 | something | 56 | | field 6 | something else | 57 | 58 | ###### Heading Six 59 | This is really deeply nested. 60 | 61 | Here is some code: 62 | ``` 63 | 10 REM Old huh? 64 | 20 REM Yup, way old! 65 | ``` 66 | The file name is `oldcode.bas`. 67 | 68 | These three lines should 69 | only be one paragaph, but with BF retaining 70 | the newlines, the newlines must be replaced with spaces. 71 | 72 | The below is a blockquote with inner codeblocks. 73 | 74 | > Example: 75 | > 76 | > sub status { 77 | > print "working"; 78 | > } 79 | > 80 | > Or: 81 | > 82 | > sub status { 83 | > return "working"; 84 | > } 85 | 86 | Here is the fpdf logo (inline):  87 | 88 | Here is a Gopher: 89 | 90 |  91 | 92 | *The Go gopher was designed by Renee French. The Gopher character design is licensed under the Creative Commons 3.0 Attributions license. Read http://blog.golang.org/gopher for more details.* 93 | 94 | 95 | __This is the last line of the document.__ 96 | -------------------------------------------------------------------------------- /testdata/Tidyness.log: -------------------------------------------------------------------------------- 1 | [RenderHeader] Not handled 2 | [Document] Not Handled 3 | [BlockQuote (entering)] 4 | -[Paragraph (entering)] 5 | -[... Margins (left, top, right, bottom:] 58.338 28.35 28.35 56.7 6 | -[cr()] LH=14 7 | -[Text] A list within a blockquote: 8 | -[Paragraph (leaving)] 9 | -[... Margins (left, top, right, bottom:] 58.338 28.35 28.35 56.7 10 | -[cr()] LH=14 11 | -[Unordered List (entering)] Container 12 | ListItem 'flags=start' 13 | Paragraph 14 | Text 'asterisk 1' 15 | ListItem 16 | Paragraph 17 | Text 'asterisk 2' 18 | ListItem 19 | Paragraph 20 | Text 'asterisk 3' 21 | 22 | -[... List Left Margin] set to 88.326 23 | --[Unordered Item (entering) #1] Container 24 | Paragraph 25 | Text 'asterisk 1' 26 | 27 | --[cr()] LH=14 28 | ---[Paragraph (entering)] 29 | ---[... Margins (left, top, right, bottom:] 128.31 28.35 28.35 56.7 30 | ---[First Para within a list] breaking 31 | ---[Text] asterisk 1 32 | ---[Paragraph (leaving)] 33 | ---[... Margins (left, top, right, bottom:] 128.31 28.35 28.35 56.7 34 | ---[Unordered Item (leaving)] Container 35 | Paragraph 36 | Text 'asterisk 1' 37 | 38 | --[Unordered Item (entering) #2] Container 39 | Paragraph 40 | Text 'asterisk 2' 41 | 42 | --[cr()] LH=14 43 | ---[Paragraph (entering)] 44 | ---[... Margins (left, top, right, bottom:] 128.31 28.35 28.35 56.7 45 | ---[First Para within a list] breaking 46 | ---[Text] asterisk 2 47 | ---[Paragraph (leaving)] 48 | ---[... Margins (left, top, right, bottom:] 128.31 28.35 28.35 56.7 49 | ---[Unordered Item (leaving)] Container 50 | Paragraph 51 | Text 'asterisk 2' 52 | 53 | --[Unordered Item (entering) #3] Container 54 | Paragraph 55 | Text 'asterisk 3' 56 | 57 | --[cr()] LH=14 58 | ---[Paragraph (entering)] 59 | ---[... Margins (left, top, right, bottom:] 128.31 28.35 28.35 56.7 60 | ---[First Para within a list] breaking 61 | ---[Text] asterisk 3 62 | ---[Paragraph (leaving)] 63 | ---[... Margins (left, top, right, bottom:] 128.31 28.35 28.35 56.7 64 | ---[Unordered Item (leaving)] Container 65 | Paragraph 66 | Text 'asterisk 3' 67 | 68 | --[Unordered List (leaving)] Container 69 | ListItem 'flags=start' 70 | Paragraph 71 | Text 'asterisk 1' 72 | ListItem 73 | Paragraph 74 | Text 'asterisk 2' 75 | ListItem 76 | Paragraph 77 | Text 'asterisk 3' 78 | 79 | --[... Reset List Left Margin] re-set to 58.337999999999994 80 | -[BlockQuote (leaving)] 81 | [cr()] LH=14 82 | [Document] Not Handled 83 | -------------------------------------------------------------------------------- /testdata/Ordered and unordered lists.html: -------------------------------------------------------------------------------- 1 |Asterisks tight:
4 | 5 |Asterisks loose:
12 | 13 |asterisk 1
asterisk 2
asterisk 3
Pluses tight:
24 | 25 |Pluses loose:
32 | 33 |Plus 1
Plus 2
Plus 3
Minuses tight:
44 | 45 |Minuses loose:
52 | 53 |Minus 1
Minus 2
Minus 3
Tight:
64 | 65 |and:
72 | 73 |Loose using tabs:
80 | 81 |First
Second
Third
and using spaces:
90 | 91 |One
Two
Three
Multiple paragraphs:
100 | 101 |Item 1, graf one.
103 | 104 |Item 2. graf two. The quick brown fox jumped over the lazy dog's 105 | back.
Item 2.
Item 3.
Here's another:
127 | 128 |Same thing but with paragraphs:
141 | 142 |First
Second:
146 | 147 |Third
This was an error in Markdown 1.0.1:
157 | 158 |this
160 | 161 |that
Now is the time for all good men to come to 82 | the aid of their country. This is just a 83 | regular paragraph.
84 | 85 |The quick brown fox jumped over the lazy 86 | dog's back.
87 | 88 |91 |97 | 98 | 99 | 100 | ### Phrase Emphasis ### 101 | 102 | Markdown uses asterisks and underscores to indicate spans of emphasis. 103 | 104 | Markdown: 105 | 106 | Some of these words *are emphasized*. 107 | Some of these words _are emphasized also_. 108 | 109 | Use two asterisks for **strong emphasis**. 110 | Or, if you prefer, __use two underscores instead__. 111 | 112 | Output: 113 | 114 |This is a blockquote.
92 | 93 |This is the second paragraph in the blockquote.
94 | 95 |This is an H2 in a blockquote
96 |
Some of these words are emphasized. 115 | Some of these words are emphasized also.
116 | 117 |Use two asterisks for strong emphasis. 118 | Or, if you prefer, use two underscores instead.
119 | 120 | 121 | 122 | ## Lists ## 123 | 124 | Unordered (bulleted) lists use asterisks, pluses, and hyphens (`*`, 125 | `+`, and `-`) as list markers. These three markers are 126 | interchangable; this: 127 | 128 | * Candy. 129 | * Gum. 130 | * Booze. 131 | 132 | this: 133 | 134 | + Candy. 135 | + Gum. 136 | + Booze. 137 | 138 | and this: 139 | 140 | - Candy. 141 | - Gum. 142 | - Booze. 143 | 144 | all produce the same output: 145 | 146 |` tags for the 168 | list item text. You can create multi-paragraph list items by indenting 169 | the paragraphs by 4 spaces or 1 tab: 170 | 171 | * A list item. 172 | 173 | With multiple paragraphs. 174 | 175 | * Another item in the list. 176 | 177 | Output: 178 | 179 |
A list item.
181 |With multiple paragraphs.
Another item in the list.
This is an 201 | example link.
202 | 203 | Optionally, you may include a title attribute in the parentheses: 204 | 205 | This is an [example link](http://example.com/ "With a Title"). 206 | 207 | Output: 208 | 209 |This is an 210 | example link.
211 | 212 | Reference-style links allow you to refer to your links by names, which 213 | you define elsewhere in your document: 214 | 215 | I get 10 times more traffic from [Google][1] than from 216 | [Yahoo][2] or [MSN][3]. 217 | 218 | [1]: http://google.com/ "Google" 219 | [2]: http://search.yahoo.com/ "Yahoo Search" 220 | [3]: http://search.msn.com/ "MSN Search" 221 | 222 | Output: 223 | 224 |I get 10 times more traffic from Google than from Yahoo or MSN.
228 | 229 | The title attribute is optional. Link names may contain letters, 230 | numbers and spaces, but are *not* case sensitive: 231 | 232 | I start my morning with a cup of coffee and 233 | [The New York Times][NY Times]. 234 | 235 | [ny times]: http://www.nytimes.com/ 236 | 237 | Output: 238 | 239 |I start my morning with a cup of coffee and 240 | The New York Times.
241 | 242 | 243 | ### Images ### 244 | 245 | Image syntax is very much like link syntax. 246 | 247 | Inline (titles are optional): 248 | 249 |  250 | 251 | Reference-style: 252 | 253 | ![alt text][id] 254 | 255 | [id]: /path/to/img.jpg "Title" 256 | 257 | Both of the above examples produce the same output: 258 | 259 |
260 |
261 |
262 |
263 | ### Code ###
264 |
265 | In a regular paragraph, you can create code span by wrapping text in
266 | backtick quotes. Any ampersands (`&`) and angle brackets (`<` or
267 | `>`) will automatically be translated into HTML entities. This makes
268 | it easy to use Markdown to write about HTML example code:
269 |
270 | I strongly recommend against using any `