Skip to content
Kagami Sascha Rosylight edited this page Dec 23, 2019 · 15 revisions

Tells ReSpec to treat the document as being in a format other than HTML. Supported formats:

"markdown"
Interpreted as GitHub flavored markdown

Example

var respecConfig = {
  format: "markdown",
}

Markdown

When format is set to "markdown", you can use a mix of HTML and markdown:

## Using markdown
This will be a paragraph. 

<pre class="example" title="A markdown example">
function thisIsNice(){
  becauseWeCanUseMarkdown();
}

// And using markdown is pretty sweet!
const foo = "FOO";
while(foo){
  Promise.all([...lotsOfPromises])
}
</pre>

ReSpec will detect minimum common indentation and deduct them so that indented texts won't be consider as code blocks.

<body>

  # This is indented markdown
  Since the minimum common indentation is 2, ReSpec will deduct them before parsing

    Indented code block

</body>

Please remember that markdown requires double newlines between an HTML tag and markdown text - but we do support single newline.

<section>

## Markdown inside HTML tags
This is the correct way to insert markdown inside HTML.

</section>

<section>
## Markdown inside HTML tags
This is supported for backward compatibility sake.
</section> 

See also: nolink class to disable automatic linking in code blocks, if needed.

Known issues

In some cases, the markdown processor gets confused. For example, given:

<pre class="example">
1 * 2 * 3;
</pre>

The "*"s get converted to an <em>. Obviously, that's not ideal. A workaround is to wrap the "*" in back-ticks, like this:

<pre class="example">
1 `*` 2 `*` 3;
</pre>

Guides

Configuration options

W3C Configuration options

Linter rules

Internal properties

Handled by ReSpec for you.

Special <section> IDs

HTML elements

Custom Elements

WebIDL

HTML attributes

CSS Classes

Special properties

Clone this wiki locally