### Install html-to-markdown Go Library
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/README.md
Use 'go get' to install the latest version of the library. Append '@commithash' for a specific commit.
```bash
go get -u github.com/JohannesKaufmann/html-to-markdown/v2
```
--------------------------------
### Install CLI via Go
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/README.md
Install the CLI directly using Go if you have it set up on your system. The executable will be placed in your Go binary directory.
```bash
go install github.com/JohannesKaufmann/html-to-markdown/v2/cli/html2markdown@latest
```
--------------------------------
### Install CLI via Homebrew
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/README.md
Use this command to install the CLI if you have Homebrew installed.
```bash
brew install JohannesKaufmann/tap/html2markdown
```
--------------------------------
### Inline Code Example
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/code.in.html
Demonstrates basic inline code formatting using single backticks.
```text
`inline code`
```
--------------------------------
### Build CLI from Source
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/README.md
Build the CLI executable locally if you have Go installed. This command compiles the source code.
```bash
go build ./cli/html2markdown
```
--------------------------------
### Check CLI Version
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/README.md
Verify the installed version of the CLI. Ensure it's v2.X.X for the current converter.
```bash
html2markdown --version
```
--------------------------------
### Basic CLI Usage - Piping from Curl
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/README.md
Convert HTML content fetched via curl from a URL to Markdown. This example shows converting a webpage.
```bash
$ curl --no-progress-meter http://example.com | html2markdown
# Example Domain
This domain is for use in illustrative examples in documents. You may use this domain in literature without prior coordination or asking for permission.
[More information...](https://www.iana.org/domains/example)
```
--------------------------------
### Inline Code Examples
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/code.out.md
Inline code is denoted by single backticks. It can include variables, sample output, keyboard input, or teletype text.
```text
`inline code`
```
```text
`variable`
```
```text
`sample output`
```
```text
`keyboard input`
```
```text
`teletype text`
```
--------------------------------
### Markdown with Hyphen causing Setext Heading
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/ESCAPING.md
A single hyphen following text can be interpreted as a Setext heading in Markdown. This example shows the problematic input.
```markdown
Paragraph 1
-
Paragraph 2
```
--------------------------------
### Configuring Converter with EscapeMode
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/ESCAPING.md
Demonstrates how to initialize a converter with a specific `EscapeMode`. The 'smart' mode is the default.
```go
conv := converter.NewConverter(
converter.WithEscapeMode("smart"), // default
converter.WithPlugins(
// ...
)
)
```
--------------------------------
### Code Blocks with Highlighting and Indentation
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/code.out.md
Demonstrates how indentation and content within code blocks are preserved, even with potential highlighting information.
```text
Line 0
Line 1 AB C
Line 2 AB C
Line 3
```
```text
Line 1 AB C
Line 2 AB C
```
```text
Line 1 AB C
Line 2 AB C
```
--------------------------------
### Advanced HTML to Markdown with Custom Converters in Go
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/README.md
For greater control, create a custom converter using NewConverter and register plugins like base and commonmark. This allows for custom delimiter configurations.
```go
package main
import (
"fmt"
"log"
"github.com/JohannesKaufmann/html-to-markdown/v2/converter"
"github.com/JohannesKaufmann/html-to-markdown/v2/plugin/base"
"github.com/JohannesKaufmann/html-to-markdown/v2/plugin/commonmark"
)
func main() {
input := `Bold Text`
conv := converter.NewConverter(
converter.WithPlugins(
base.NewBasePlugin(),
commonmark.NewCommonmarkPlugin(
commonmark.WithStrongDelimiter("__"),
// ...additional configurations for the plugin
),
// ...additional plugins (e.g. table)
),
)
markdown, err := conv.ConvertString(input)
if err != nil {
log.Fatal(err)
}
fmt.Println(markdown)
// Output: __Bold Text__
}
```
--------------------------------
### File Input/Output CLI Usage
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/README.md
Convert HTML from an input file to a Markdown output file, or process multiple HTML files into a directory.
```bash
$ html2markdown --input file.html --output file.md
$ html2markdown --input "src/*.html" --output "dist/"
```
--------------------------------
### Basic Unordered List
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/list.out.md
Demonstrates a simple unordered list with nested sub-lists.
```markdown
- 1
- 2
- - 3.1
- 3.2
- 4 Before
- 4.1
- 4.2
- - 5.1
5 After
- 6 Before
6 also Before
- 6A.1
6 Between
- 6B.1
6 After
6 also After
- 7
```
--------------------------------
### List with Links
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/list.out.md
Demonstrates list items containing inline links.
```markdown
- Before [text](/page) after
```
```markdown
- A double `**` [can open strong emphasis](/page)
```
--------------------------------
### Basic CLI Usage - Piping HTML
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/README.md
Convert HTML piped from standard input to Markdown on standard output. This is a simple way to convert small snippets.
```bash
$ echo "important" | html2markdown
**important**
```
--------------------------------
### Empty Inline Code and Fenced Code Blocks
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/code.out.md
Demonstrates handling of empty inline code and empty fenced code blocks, including those with only spaces.
```text
before` `after
```
```text
before ` ` after
```
```text
before ` ` after
```
```text
before` `after
```
```text
before ` ` after
```
```text
before ` ` after
```
```text
beforeafter
```
```text
before after
```
```text
before after
```
```text
```
```text
```
```text
```
```text
```
```text
```
```text
Beginning of code
End of code
```
```text
Start of many newlines
End of many newlines
```
--------------------------------
### Preformatted Text with Indentation
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/code.in.html
Demonstrates preformatted text with varying levels of indentation.
```text
Line 1 AB C
Line 2 AB C
```
--------------------------------
### Inline Code with Internal Backticks
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/code.in.html
Demonstrates how to use inline code that contains backticks.
```text
``with ` backtick``
```
```text
`with `` backticks`
```
```text
``a ``` b ```` c ` d``
```
```text
`` `starting & ending with a backtick` ``
```
--------------------------------
### Ordered List with Numbering Issues
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/list.out.md
Illustrates ordered lists where numbering might be ambiguous or non-standard.
```markdown
1. one
2. two
```
```markdown
8. a
9. b
```
```markdown
09. a
10. b
```
--------------------------------
### Code Block with Fenced Tildes
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/code.in.html
Demonstrates code blocks delimited by triple tildes.
```text
~~~
Some ```
totally `````` normal
` code
Some ~~~
totally ~~~~~~ normal
~ code
```
--------------------------------
### Basic HTML to Markdown Conversion in Go
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/README.md
Converts a simple HTML string to Markdown using the ConvertString function. Ensure the html-to-markdown/v2 package is imported.
```go
package main
import (
"fmt"
"log"
htmltomarkdown "github.com/JohannesKaufmann/html-to-markdown/v2"
)
func main() {
input := `Bold Text`
markdown, err := htmltomarkdown.ConvertString(input)
if err != nil {
log.Fatal(err)
}
fmt.Println(markdown)
// Output: **Bold Text**
}
```
--------------------------------
### Inline Code with Variables
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/code.in.html
Shows inline code used to represent variables and equations.
```text
`x = 3`
```
```text
`x + 2 = 5`
```
```text
`x = y + 2`
```
--------------------------------
### Blockquote with Empty Lines
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/blockquote.in.html
Shows how empty lines within a blockquote are handled, including indentation.
```markdown
> Start Line
>
>
>
>
>
>
>
>
> End Line
```
--------------------------------
### Convert Relative Links to Absolute in Go
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/README.md
Use the WithDomain option in ConvertString to transform relative URLs in HTML to absolute URLs in the Markdown output. Requires importing the converter package.
```go
package main
import (
"fmt"
"log"
htmltomarkdown "github.com/JohannesKaufmann/html-to-markdown/v2"
"github.com/JohannesKaufmann/html-to-markdown/v2/converter"
)
func main() {
input := `
`
markdown, err := htmltomarkdown.ConvertString(
input,
converter.WithDomain("https://example.com"),
)
if err != nil {
log.Fatal(err)
}
fmt.Println(markdown)
// Output: 
}
```
--------------------------------
### Code Block with Indentation and Content
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/code.in.html
Illustrates code blocks with leading/trailing spaces and indented content.
```text
Line 1 AB C
Line 2 AB C
```
```text
Line 1 AB C
Line 2 AB C
```
--------------------------------
### Code Blocks with Fence Characters
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/code.out.md
Demonstrates how code blocks are handled when their content includes characters used for fencing (backticks or tildes).
```text
````
```
````
```
```text
```
~~~
```
```
```text
`````
Some ```
totally `````` normal
` code
``````
```
```text
```
Some ~~~
totally ~~~~~~ normal
~ code
```
```
--------------------------------
### List Items with Breaks
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/list.out.md
Demonstrates list items containing explicit line breaks.
```markdown
- Start Line
End Line
- Start Line
End Line
```
--------------------------------
### Mixed Code and Preformatted Blocks
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/code.out.md
Shows the distinction between inline code and fenced preformatted blocks when they appear together.
```text
before `just code` after
```
```text
before
```
just pre
```
after
```
```text
before
```
code inside pre
```
after
```
```text
before
```
pre inside code
```
after
```
```text
before `// just code // another line` after
```
```text
before
```
// just pre
// another line
```
after
```
```text
before
```
// code inside pre
// another line
```
after
```
```text
before
```
// pre inside code
// another line
```
after
```
--------------------------------
### List with Blockquote
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/list.out.md
Shows a list item containing a blockquote.
```markdown
- First
- Someone once said:
> My famous quote
\- someone
```
--------------------------------
### List with Blockquote and Line Breaks
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/list.out.md
A list item containing a blockquote with multiple lines.
```markdown
1. > Line A
> Line B
```
--------------------------------
### Blockquote with Other Elements
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/blockquote.out.md
Shows a blockquote containing a heading, a list, and a code block.
```markdown
> ## Heading
>
> 1. List Item 1
> 2. List Item 2
>
> A code block:
>
> ```
> code block content
> ```
```
--------------------------------
### Blockquote with Indented Empty Lines
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/blockquote.in.html
Illustrates blockquotes with indented empty lines.
```markdown
> Start Line
>
>
>
>
>
> End Line
```
--------------------------------
### Blockquote with Markdown Elements
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/blockquote.in.html
Shows a blockquote containing a heading, list items, and a code block.
```markdown
> Heading
> -------
>
> 1. List Item 1
> 2. List Item 2
>
> A code block:
>
> code block content
```
--------------------------------
### Nested Blockquote
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/blockquote.out.md
Demonstrates a blockquote nested within another blockquote.
```markdown
> before
>
> > nested
>
> after
```
--------------------------------
### Complex Nested Lists
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/list.out.md
Illustrates deeply nested lists and lists containing other elements.
```markdown
- - List 1
- List 2
- List 3
```
```markdown
1. 1. 1. 1. 1. lots of list containers
```
```markdown
1. 1. 1. lots of list items
```
```markdown
1. A 1 (div)
A 2 (#text)
2. A 3 (li) A 4 (#text)
1. B 1 (li)
1. C 1 (li)
C 2 (div)
C 3 (div)
B 2 (div)
2. B 3 (li)
```
--------------------------------
### Simple Blockquote
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/blockquote.out.md
A basic blockquote with multiple lines of text.
```markdown
> First Line Second Line Third Line
```
--------------------------------
### Multiple Adjacent Lists
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/list.out.md
Shows how consecutive lists are parsed as distinct elements.
```markdown
- List 1
- List 2
- List 3
- List 4
text between
- List 5
- List 6
- List 7
```
--------------------------------
### Blockquote with Line Breaks
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/blockquote.out.md
Illustrates blockquotes with explicit line breaks using a backslash.
```markdown
> Line A
> Line B
```
--------------------------------
### Register Custom Tag Handlers in Go
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/README.md
Customize how specific HTML tags are processed during conversion. Use TagTypeRemove to exclude tags, TagTypeInline/TagTypeBlock for node types, and specify renderers like RenderAsHTML or RenderAsHTMLWrapper with priorities.
```go
conv.Register.TagType("nav", converter.TagTypeRemove, converter.PriorityStandard)
conv.Register.RendererFor("b", converter.TagTypeInline, base.RenderAsHTML, converter.PriorityEarly)
conv.Register.RendererFor("article", converter.TagTypeBlock, base.RenderAsHTMLWrapper, converter.PriorityStandard)
```
--------------------------------
### Special Characters in Lists
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/list.out.md
Demonstrates how special characters are handled within list items, including escaped characters.
```markdown
1.\
\-
\+
\*
```
```markdown
1. not a list
\- not a list
\+ not a list
\* not a list
```
--------------------------------
### Markdown Output with Smart Escaping
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/ESCAPING.md
Shows the markdown output when using 'smart' escaping mode, where special characters like asterisks are escaped to prevent markdown interpretation.
```markdown
fake \*\*bold\*\* and real **bold**
```
--------------------------------
### Preformatted Text Block
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/code.in.html
Represents preformatted text using indentation.
```text
End of code
```
```text
Start of many newlines
End of many newlines
```
--------------------------------
### Nested List Item with Code Block
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/list.out.md
Illustrates a nested list item containing a fenced code block.
```markdown
- item 1:
- nested item 1:
```
line 1
line 2
```
- nested item 2
- item 2
```
--------------------------------
### Inline Code with Only Backticks
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/code.in.html
Shows inline code that consists solely of backticks.
```text
before` `` `after
```
```text
before ` `` ` after
```
--------------------------------
### List Item with Code Block
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/list.out.md
Shows a list item containing a fenced code block.
```markdown
- item:
```
line 1
line 2
```
- item 2
```
--------------------------------
### Code Block with Fenced Backticks
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/code.in.html
Illustrates code blocks delimited by triple backticks.
```text
```
~~~
Some ```
totally `````` normal
` code
Some ~~~
totally ~~~~~~ normal
~ code
```
--------------------------------
### Code Block with Comments
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/code.in.html
Shows code blocks containing comments, including multi-line comments.
```javascript
// just code // another line
```
```javascript
// pre inside code // another line
```
--------------------------------
### Fenced Code Blocks with HTML and Lists
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/code.out.md
Fenced code blocks can contain HTML tags and Markdown list syntax, which are rendered literally.
```html
The tag is used to embed an image.
The tag is used to embed an image.
```
```markdown
List Item One
List Item Two
List Item Three
```
--------------------------------
### Blockquote with Multiple Breaks
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/blockquote.out.md
Shows blockquotes with empty lines between paragraphs.
```markdown
> Start Line
>
> End Line
```
--------------------------------
### Code Block Conversion
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/table/testdata/GoldenFiles/contents.out.md
Plain text within a code block is preserved as is in Markdown.
```plaintext
Code block
```
--------------------------------
### Inline Code with Special Characters
Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/code.in.html
Illustrates inline code containing HTML tags and other special characters.
```text
`
` ``` ```text `` ``` -------------------------------- ### Not a Blockquote Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/blockquote.in.html Illustrates content that is not interpreted as a blockquote. ```text Not a > blockquote ``` -------------------------------- ### Inline Code with Other Formatting Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/code.out.md Inline code can be combined with other Markdown formatting like bold and italics. ```text before **`inline code`** after ``` ```text before *`inline code`* after ``` ```text before**a`inline code`b**after ``` ```text before**a`inline code`b**after ``` ```text before **`inline code`** after ``` ```text before **`inline code`** after ``` ```text before *`inline code` and `inline code`* after ``` ```text before *`inline code` and `inline code`* after ``` ```text before **`inline code`** after ``` ```text before *`inline code`* after ``` ```text before **`inline code`** after ``` ```text before *`inline code`* after ``` ```text before **`
`** after ``` -------------------------------- ### Ordered List with Complex Item Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/list.out.md An ordered list where an item contains a blockquote. ```markdown 12. Someone once said: > My famous quote \- someone ``` -------------------------------- ### HTML Entity as Blockquote Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/blockquote.out.md Shows that HTML entities for greater-than signs can be used to represent blockquote-like text. ```html > not a blockquote ``` -------------------------------- ### Escaped Greater Than Sign Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/blockquote.in.html Demonstrates how an escaped greater-than sign is not treated as a blockquote. ```text \> not a blockquote ``` -------------------------------- ### Markdown Output with Disabled Escaping Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/ESCAPING.md Illustrates the markdown output when escaping is disabled. This can lead to unintended rendering, such as distinguishing between fake and real bold text. ```markdown fake **bold** and real **bold** ``` -------------------------------- ### Adjacent Inline Code Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/code.out.md Multiple inline code elements can appear next to each other, with or without spaces. ```text before `A` middle `B` after ``` ```text before`A`middle`B`after ``` ```text before `A` `B` after ``` ```text before`AB`after ``` ```text `ABCDE` ``` -------------------------------- ### Large Blockquote Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/blockquote.out.md A blockquote containing multiple paragraphs. ```markdown > Paragraph 1 > > Paragraph 2 > > Paragraph 3 ``` -------------------------------- ### Code Blocks with Language Identifiers Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/code.out.md Fenced code blocks can include a language identifier after the opening fence, which is typically used for syntax highlighting. ```one content ``` ```two content ``` -------------------------------- ### Inline Code with Whitespace at Edges Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/code.out.md Inline code preserves leading and trailing whitespace within the backticks. ```text `inline code` ``` ```text `inline code` ``` ```text `inline code` ``` ```text `inline code` ``` ```text `inline code` ``` -------------------------------- ### Inline Code with HTML Tags Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/code.out.md Inline code can contain HTML tags, which are treated as literal characters within the code. ```text before `` after ``` ```text before after ``` ```text before `A middle B` after ``` -------------------------------- ### Escaping Hyphen to Prevent Setext Heading Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/ESCAPING.md Escaping a hyphen with a backslash prevents it from being interpreted as a Setext heading, ensuring it renders as plain text. ```markdown Paragraph 1 \- Paragraph 2 ``` -------------------------------- ### HTML Entity Not a Blockquote Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/blockquote.out.md Illustrates that HTML entities for greater-than signs do not create blockquotes. ```html Not a > blockquote ``` -------------------------------- ### Inline Code Containing Backticks Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/code.out.md Inline code can contain backticks by using a different number of backticks to delimit it, or by escaping. ```text ``with ` backtick`` ``` ```text ```with `` backticks``` ``` ```text `````a ``` b ```` c ` d````` ``` ```text `` `starting & ending with a backtick` `` ``` ```text before``` `` ```after ``` ```text before``` `` ```after ``` ```text before``` `` ```after ``` ```text before ``` `` ``` after ``` ```text before ``` `` ``` after ``` ```text before ``` `` ``` after ``` ```text before ``` `` ``` after ``` ```text before ``` `` ``` after ``` ```text before ``` `` ``` after ``` -------------------------------- ### Inline Code within Text Source: https://github.com/johanneskaufmann/html-to-markdown/blob/main/plugin/commonmark/testdata/GoldenFiles/code.out.md Inline code can be embedded within regular text to denote variables or simple expressions. ```text When `x = 3`, that means `x + 2 = 5` ``` ```text A simple equation: `x` = `y` + 2 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.