> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.doc-detective.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.doc-detective.com/_mcp/server.

# Custom detection, written as tests

> Procedures whose detected tests come from custom fileTypes, with selectors, regex definitions, custom statement syntax, and a plain-text format, shown as prose, detected tests, inline tests, and a standalone spec.

Each example on this page shows one documented procedure as prose, detected tests, inline tests, and a standalone spec. For what each tab holds, see [Navigation and interaction](/reference/docs-as-tests/navigation-interaction).

Here, the detected variants run with custom [`fileTypes`](/reference/schemas/config), and each example's config sits above its tabs. The prose, inline, and standalone variants are the same as on any other page. For how selectors and regex definitions work, see [Selectors](/docs/input-formats/selectors) and [Custom input formats](/docs/input-formats/custom).

Custom definitions match what one format writes, so most examples show only the formats their definitions apply to.

## Extend Markdown with your own conventions

This file type uses [`extends`](/reference/schemas/config), `name`, and `extensions` to build on the Markdown and MDX defaults. Its [`markup`](/reference/schemas/markup-definition) uses the `link`, `strong`, `text`, `element`, and `emphasis` selectors with `precededBy`, `excludes`, `captures`, and `regex`, and `element` in its string form. Its [`inlineStatements`](/reference/schemas/config) read statements from comments that start with `dd:`. The steps are [`goTo`](/docs/actions/goto), [`find`](/docs/actions/find), [`click`](/docs/actions/click), [`type`](/docs/actions/type), and [`wait`](/docs/actions/wait).

**`doc-detective.json (fileTypes)`**

```json title="doc-detective.json (fileTypes)"
{
  "fileTypes": [
    {
      "name": "markdown-ui",
      "extends": "markdown",
      "extensions": ["md", "mdx"],
      "inlineStatements": {
        "in": [{ "comment": {}, "regex": "^dd:\\s*([\\s\\S]*)$" }]
      },
      "markup": [
        {
          "name": "goToUrl",
          "link": { "url": "^https?://", "precededBy": "\\b[Gg]o to(?: the)?\\s+$", "excludes": "^\\s*$" },
          "captures": ["url", "text"],
          "actions": ["goTo", { "find": "$2" }]
        },
        {
          "name": "clickOnscreenText",
          "strong": { "precededBy": "\\b(?:[Cc]lick|[Ss]elect)\\s+$" },
          "actions": ["click"]
        },
        {
          "name": "findOnscreenText",
          "strong": { "excludes": "^(?:Note|Tip):?$" },
          "actions": ["find"]
        },
        {
          "name": "typeText",
          "text": { "excludes": "^\\s*For example\\b" },
          "regex": "\\b(?:[Pp]ress|[Ee]nter|[Tt]ype)\\b\\s+\"([^\"]+)\"",
          "actions": ["type"]
        },
        {
          "name": "typeKeyboardInput",
          "element": { "tag": ["kbd"], "precededBy": "\\b[Ee]nter\\s+$", "excludes": "^(?:Enter|Tab|Esc|Ctrl|Shift|Alt)\\b" },
          "captures": ["content"],
          "actions": ["type"]
        },
        {
          "name": "waitForUpdate",
          "emphasis": { "precededBy": "\\b[Ww]ait\\s+$", "excludes": "^0 ms$" },
          "regex": "^(\\d+) ms$",
          "actions": ["wait"]
        },
        {
          "name": "findSampleOutput",
          "element": "samp",
          "actions": ["find"]
        }
      ]
    },
    "asciidoc",
    "html",
    "dita",
    "rst"
  ]
}
```

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Echo text back

**Note:** The field echoes each keystroke below it.

**Tip:** For example, type "Hi" to see a short echo.

1. Go to the [Type Echo Test Page](http://localhost:8092/type-echo.html).
2. Click **Type here:**.
3. Enter <kbd>Hello, Doc Detective</kbd>.
4. Wait _500 ms_ for the echo.
5. Check that the page shows <samp>Hello, Doc Detective</samp> below the field.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Echo text back

**Note:** The field echoes each keystroke below it.

**Tip:** For example, type "Hi" to see a short echo.

1. Go to the [Type Echo Test Page](http://localhost:8092/type-echo.html).
2. Click **Type here:**.
3. Enter <kbd>Hello, Doc Detective</kbd>.
4. Wait _500 ms_ for the echo.
5. Check that the page shows <samp>Hello, Doc Detective</samp> below the field.
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- dd: test {"testId":"custom-markdown-extend","detectSteps":true} -->

# Echo text back

**Note:** The field echoes each keystroke below it.

**Tip:** For example, type "Hi" to see a short echo.

1. Go to the [Type Echo Test Page](http://localhost:8092/type-echo.html).
2. Click **Type here:**.
3. Enter <kbd>Hello, Doc Detective</kbd>.
4. Wait _500 ms_ for the echo.
5. Check that the page shows <samp>Hello, Doc Detective</samp> below the field.

<!-- dd: test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* dd: test {"testId":"custom-markdown-extend","detectSteps":true} */}

# Echo text back

**Note:** The field echoes each keystroke below it.

**Tip:** For example, type "Hi" to see a short echo.

1. Go to the [Type Echo Test Page](http://localhost:8092/type-echo.html).
2. Click **Type here:**.
3. Enter <kbd>Hello, Doc Detective</kbd>.
4. Wait _500 ms_ for the echo.
5. Check that the page shows <samp>Hello, Doc Detective</samp> below the field.

{/* dd: test end */}
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"custom-markdown-extend","detectSteps":false} -->

# Echo text back

**Note:** The field echoes each keystroke below it.

**Tip:** For example, type "Hi" to see a short echo.

1. Go to the [Type Echo Test Page](http://localhost:8092/type-echo.html).
   <!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
   <!-- step {"find":"Type Echo Test Page"} -->
2. Click **Type here:**.
   <!-- step {"click":"Type here:"} -->
3. Enter <kbd>Hello, Doc Detective</kbd>.
   <!-- step {"type":"Hello, Doc Detective"} -->
4. Wait _500 ms_ for the echo.
   <!-- step {"wait":500} -->
5. Check that the page shows <samp>Hello, Doc Detective</samp> below the field.
   <!-- step {"find":"Hello, Doc Detective"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"custom-markdown-extend","detectSteps":false} */}

# Echo text back

**Note:** The field echoes each keystroke below it.

**Tip:** For example, type "Hi" to see a short echo.

1. Go to the [Type Echo Test Page](http://localhost:8092/type-echo.html).
   {/* step {"goTo":"http://localhost:8092/type-echo.html"} */}
   {/* step {"find":"Type Echo Test Page"} */}
2. Click **Type here:**.
   {/* step {"click":"Type here:"} */}
3. Enter <kbd>Hello, Doc Detective</kbd>.
   {/* step {"type":"Hello, Doc Detective"} */}
4. Wait _500 ms_ for the echo.
   {/* step {"wait":500} */}
5. Check that the page shows <samp>Hello, Doc Detective</samp> below the field.
   {/* step {"find":"Hello, Doc Detective"} */}

{/* test end */}
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-markdown-extend",
      "steps": [
        {
          "goTo": "http://localhost:8092/type-echo.html"
        },
        {
          "find": "Type Echo Test Page"
        },
        {
          "click": "Type here:"
        },
        {
          "type": "Hello, Doc Detective"
        },
        {
          "wait": 500
        },
        {
          "find": "Hello, Doc Detective"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-markdown-extend
    steps:
      - goTo: http://localhost:8092/type-echo.html
      - find: Type Echo Test Page
      - click: "Type here:"
      - type: Hello, Doc Detective
      - wait: 500
      - find: Hello, Doc Detective
```

### What detection finds

| Prose                                | Definition                                                | Detected steps                                                        |
| ------------------------------------ | --------------------------------------------------------- | --------------------------------------------------------------------- |
| `Go to the [Type Echo Test Page](…)` | `goToUrl`, replaced                                       | `goTo` the URL and `find` the link text, then the default `checkLink` |
| `**Note:**` and `**Tip:**`           | `findOnscreenText`, replaced                              | None. `excludes` skips the labels                                     |
| `For example, type "Hi"`             | `typeText`, replaced                                      | None. `text.excludes` skips sentences that start with "For example"   |
| `Click **Type here:**`               | `clickOnscreenText` and `findOnscreenText`, both replaced | `click`, then `find`                                                  |
| `Enter <kbd>…</kbd>`                 | `typeKeyboardInput`                                       | `type` the element's content                                          |
| `Wait _500 ms_`                      | `waitForUpdate`                                           | `wait` 500                                                            |
| `<samp>Hello, Doc Detective</samp>`  | `findSampleOutput`                                        | `find` the sample output                                              |

* With `extends`, a definition whose `name` matches a built-in one replaces it, and the rest of the built-in definitions still run. That's how `goToUrl` changes here, and why the link still gets the default `checkLink`.
* The replaced `clickOnscreenText` clicks only after `Click` or `Select`. The built-in one also clicks after verbs such as `Check` and `Choose`.
* Each `excludes` keeps a look-alike from becoming a step. Here, that's a link with no text, a key name such as `<kbd>Tab</kbd>`, and a zero wait.
* `"element": "samp"` is short for `{ "tag": ["samp"] }`. `<samp>` marks sample output, so finding it checks what the page shows.
* `captures` picks the values for `$1`, `$2`, and so on. An action name, such as `"goTo"`, takes `$1`. An object, such as `{ "find": "$2" }`, is a step template.
* The `dd:` prefix is the custom part of the statements. `inlineStatements` from `extends` still read plain `test` comments, so the inline variants need no custom config.
* In Markdown and MDX, `<kbd>` and `<samp>` are HTML tags, so the `element` selector finds them in both formats.

## Run a script split across code blocks

Each file type extends a built-in format and adds one `codeBlock` definition. It uses `language`, `excludes`, and `batchMatches` to join a tutorial's code blocks into one [`runCode`](/docs/actions/runcode) step.

**`doc-detective.json (fileTypes, one entry)`**

```json title="doc-detective.json (fileTypes, one entry)"
{
  "extends": "markdown",
  "markup": [
    {
      "name": "runCode",
      "codeBlock": { "language": ["javascript", "js"], "excludes": "^// Don't run" },
      "batchMatches": true,
      "actions": [{ "runCode": { "language": "javascript", "code": "$1" } }]
    }
  ]
}
```

The config repeats this entry with `extends` set to `asciidoc`, `html`, `rst`, and `dita`, because each entry extends one format.

#### Prose

#### Markdown

**`prose.md`**

````markdown title="prose.md"
# Print a greeting with Node.js

Define the name to greet:

```javascript
const name = "Doc Detective";
```

Don't declare `name` a second time. A script that does throws a `SyntaxError`:

```javascript
// Don't run: this redeclares name.
const name = "someone else";
```

Print the greeting:

```javascript
console.log(`Hello, ${name}!`);
```

The script prints `Hello, Doc Detective!`.
````

#### MDX

**`prose.mdx`**

````mdx title="prose.mdx"
# Print a greeting with Node.js

Define the name to greet:

```javascript
const name = "Doc Detective";
```

Don't declare `name` a second time. A script that does throws a `SyntaxError`:

```javascript
// Don't run: this redeclares name.
const name = "someone else";
```

Print the greeting:

```javascript
console.log(`Hello, ${name}!`);
```

The script prints `Hello, Doc Detective!`.
````

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Print a greeting with Node.js

Define the name to greet:

[source,javascript]
----
const name = "Doc Detective";
----

Don't declare `name` a second time. A script that does throws a `SyntaxError`:

[source,javascript]
----
// Don't run: this redeclares name.
const name = "someone else";
----

Print the greeting:

[source,javascript]
----
console.log(`Hello, ${name}!`);
----

The script prints `Hello, Doc Detective!`.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Print a greeting with Node.js</title></head>
<body>
<h1>Print a greeting with Node.js</h1>
<p>Define the name to greet:</p>
<pre><code class="language-javascript">const name = "Doc Detective";</code></pre>
<p>Don't declare <code>name</code> a second time. A script that does throws a <code>SyntaxError</code>:</p>
<pre><code class="language-javascript">// Don't run: this redeclares name.
const name = "someone else";</code></pre>
<p>Print the greeting:</p>
<pre><code class="language-javascript">console.log(`Hello, ${name}!`);</code></pre>
<p>The script prints <code>Hello, Doc Detective!</code>.</p>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Print a greeting with Node.js
=============================

Define the name to greet:

.. code-block:: javascript

   const name = "Doc Detective";

Don't declare ``name`` a second time. A script that does throws a ``SyntaxError``:

.. code-block:: javascript

   // Don't run: this redeclares name.
   const name = "someone else";

Print the greeting:

.. code-block:: javascript

   console.log(`Hello, ${name}!`);

The script prints ``Hello, Doc Detective!``.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="custom-script-blocks">
  <title>Print a greeting with Node.js</title>
  <taskbody>
    <steps>
      <step><cmd>Define the name to greet:</cmd>
        <info><codeblock outputclass="language-javascript">const name = "Doc Detective";</codeblock>
          <p>Don't declare <codeph>name</codeph> a second time. A script that does throws a <codeph>SyntaxError</codeph>:</p>
          <codeblock outputclass="language-javascript">// Don't run: this redeclares name.
const name = "someone else";</codeblock></info></step>
      <step><cmd>Print the greeting:</cmd>
        <info><codeblock outputclass="language-javascript">console.log(`Hello, ${name}!`);</codeblock></info>
        <stepresult>The script prints <codeph>Hello, Doc Detective!</codeph>.</stepresult></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

````markdown title="detected.md"
<!-- test {"testId":"custom-script-blocks","detectSteps":true} -->

# Print a greeting with Node.js

Define the name to greet:

```javascript
const name = "Doc Detective";
```

Don't declare `name` a second time. A script that does throws a `SyntaxError`:

```javascript
// Don't run: this redeclares name.
const name = "someone else";
```

Print the greeting:

```javascript
console.log(`Hello, ${name}!`);
```

The script prints `Hello, Doc Detective!`.

<!-- test end -->
````

#### MDX

**`detected.mdx`**

````mdx title="detected.mdx"
{/* test {"testId":"custom-script-blocks","detectSteps":true} */}

# Print a greeting with Node.js

Define the name to greet:

```javascript
const name = "Doc Detective";
```

Don't declare `name` a second time. A script that does throws a `SyntaxError`:

```javascript
// Don't run: this redeclares name.
const name = "someone else";
```

Print the greeting:

```javascript
console.log(`Hello, ${name}!`);
```

The script prints `Hello, Doc Detective!`.

{/* test end */}
````

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Print a greeting with Node.js

// (test {"testId":"custom-script-blocks","detectSteps":true})

Define the name to greet:

[source,javascript]
----
const name = "Doc Detective";
----

Don't declare `name` a second time. A script that does throws a `SyntaxError`:

[source,javascript]
----
// Don't run: this redeclares name.
const name = "someone else";
----

Print the greeting:

[source,javascript]
----
console.log(`Hello, ${name}!`);
----

The script prints `Hello, Doc Detective!`.

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Print a greeting with Node.js</title></head>
<body>
<!-- test {"testId":"custom-script-blocks","detectSteps":true} -->
<h1>Print a greeting with Node.js</h1>
<p>Define the name to greet:</p>
<pre><code class="language-javascript">const name = "Doc Detective";</code></pre>
<p>Don't declare <code>name</code> a second time. A script that does throws a <code>SyntaxError</code>:</p>
<pre><code class="language-javascript">// Don't run: this redeclares name.
const name = "someone else";</code></pre>
<p>Print the greeting:</p>
<pre><code class="language-javascript">console.log(`Hello, ${name}!`);</code></pre>
<p>The script prints <code>Hello, Doc Detective!</code>.</p>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Print a greeting with Node.js
=============================

.. test {"testId":"custom-script-blocks","detectSteps":true}

Define the name to greet:

.. code-block:: javascript

   const name = "Doc Detective";

Don't declare ``name`` a second time. A script that does throws a ``SyntaxError``:

.. code-block:: javascript

   // Don't run: this redeclares name.
   const name = "someone else";

Print the greeting:

.. code-block:: javascript

   console.log(`Hello, ${name}!`);

The script prints ``Hello, Doc Detective!``.

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="custom-script-blocks">
  <title>Print a greeting with Node.js</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"custom-script-blocks","detectSteps":true}'/>
    <steps>
      <step><cmd>Define the name to greet:</cmd>
        <info><codeblock outputclass="language-javascript">const name = "Doc Detective";</codeblock>
          <p>Don't declare <codeph>name</codeph> a second time. A script that does throws a <codeph>SyntaxError</codeph>:</p>
          <codeblock outputclass="language-javascript">// Don't run: this redeclares name.
const name = "someone else";</codeblock></info></step>
      <step><cmd>Print the greeting:</cmd>
        <info><codeblock outputclass="language-javascript">console.log(`Hello, ${name}!`);</codeblock></info>
        <stepresult>The script prints <codeph>Hello, Doc Detective!</codeph>.</stepresult></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

````markdown title="inline.md"
<!-- test {"testId":"custom-script-blocks","detectSteps":false} -->

# Print a greeting with Node.js

Define the name to greet:

```javascript
const name = "Doc Detective";
```

Don't declare `name` a second time. A script that does throws a `SyntaxError`:

```javascript
// Don't run: this redeclares name.
const name = "someone else";
```

Print the greeting:

```javascript
console.log(`Hello, ${name}!`);
```

<!-- step {"runCode":{"language":"javascript","code":"const name = \"Doc Detective\";\nconsole.log(`Hello, ${name}!`);","stdio":"Hello, Doc Detective!"}} -->

The script prints `Hello, Doc Detective!`.

<!-- test end -->
````

#### MDX

**`inline.mdx`**

````mdx title="inline.mdx"
{/* test {"testId":"custom-script-blocks","detectSteps":false} */}

# Print a greeting with Node.js

Define the name to greet:

```javascript
const name = "Doc Detective";
```

Don't declare `name` a second time. A script that does throws a `SyntaxError`:

```javascript
// Don't run: this redeclares name.
const name = "someone else";
```

Print the greeting:

```javascript
console.log(`Hello, ${name}!`);
```

{/* step {"runCode":{"language":"javascript","code":"const name = \"Doc Detective\";\nconsole.log(`Hello, ${name}!`);","stdio":"Hello, Doc Detective!"}} */}

The script prints `Hello, Doc Detective!`.

{/* test end */}
````

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Print a greeting with Node.js

// (test {"testId":"custom-script-blocks","detectSteps":false})

Define the name to greet:

[source,javascript]
----
const name = "Doc Detective";
----

Don't declare `name` a second time. A script that does throws a `SyntaxError`:

[source,javascript]
----
// Don't run: this redeclares name.
const name = "someone else";
----

Print the greeting:

[source,javascript]
----
console.log(`Hello, ${name}!`);
----

// (step {"runCode":{"language":"javascript","code":"const name = \"Doc Detective\";\nconsole.log(`Hello, ${name}!`);","stdio":"Hello, Doc Detective!"}})

The script prints `Hello, Doc Detective!`.

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Print a greeting with Node.js</title></head>
<body>
<!-- test {"testId":"custom-script-blocks","detectSteps":false} -->
<h1>Print a greeting with Node.js</h1>
<p>Define the name to greet:</p>
<pre><code class="language-javascript">const name = "Doc Detective";</code></pre>
<p>Don't declare <code>name</code> a second time. A script that does throws a <code>SyntaxError</code>:</p>
<pre><code class="language-javascript">// Don't run: this redeclares name.
const name = "someone else";</code></pre>
<p>Print the greeting:</p>
<pre><code class="language-javascript">console.log(`Hello, ${name}!`);</code></pre>
<!-- step {"runCode":{"language":"javascript","code":"const name = \"Doc Detective\";\nconsole.log(`Hello, ${name}!`);","stdio":"Hello, Doc Detective!"}} -->
<p>The script prints <code>Hello, Doc Detective!</code>.</p>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Print a greeting with Node.js
=============================

.. test {"testId":"custom-script-blocks","detectSteps":false}

Define the name to greet:

.. code-block:: javascript

   const name = "Doc Detective";

Don't declare ``name`` a second time. A script that does throws a ``SyntaxError``:

.. code-block:: javascript

   // Don't run: this redeclares name.
   const name = "someone else";

Print the greeting:

.. code-block:: javascript

   console.log(`Hello, ${name}!`);

.. step {"runCode":{"language":"javascript","code":"const name = \"Doc Detective\";\nconsole.log(`Hello, ${name}!`);","stdio":"Hello, Doc Detective!"}}

The script prints ``Hello, Doc Detective!``.

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="custom-script-blocks">
  <title>Print a greeting with Node.js</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"custom-script-blocks","detectSteps":false}'/>
    <steps>
      <step><cmd>Define the name to greet:</cmd>
        <info><codeblock outputclass="language-javascript">const name = "Doc Detective";</codeblock>
          <p>Don't declare <codeph>name</codeph> a second time. A script that does throws a <codeph>SyntaxError</codeph>:</p>
          <codeblock outputclass="language-javascript">// Don't run: this redeclares name.
const name = "someone else";</codeblock></info></step>
      <step><cmd>Print the greeting:</cmd>
        <info><codeblock outputclass="language-javascript">console.log(`Hello, ${name}!`);</codeblock>
          <data name="doc-detective" value='step {"runCode":{"language":"javascript","code":"const name = \"Doc Detective\";\nconsole.log(`Hello, ${name}!`);","stdio":"Hello, Doc Detective!"}}'/></info>
        <stepresult>The script prints <codeph>Hello, Doc Detective!</codeph>.</stepresult></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-script-blocks",
      "steps": [
        {
          "runCode": {
            "language": "javascript",
            "code": "const name = \"Doc Detective\";\nconsole.log(`Hello, ${name}!`);",
            "stdio": "Hello, Doc Detective!"
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-script-blocks
    steps:
      - runCode:
          language: javascript
          code: |-
            const name = "Doc Detective";
            console.log(`Hello, ${name}!`);
          stdio: Hello, Doc Detective!
```

### What detection finds

In every format, detection resolves the three code blocks to one `runCode` step:

* `batchMatches` joins the matching blocks, in document order and separated by newlines, into one `$1`. The script runs as one program, so the second block can use `name` from the first.
* `excludes` skips the block that starts with `// Don't run`. Run with the other blocks, it would declare `name` a second time and fail.
* The definition's `name`, `runCode`, replaces the built-in `runCode` definition. The built-in one runs each block as its own step and marks it `unsafe`.
* The inline and standalone variants also set `stdio`, to check what the script prints. A detected step has only what the definition's template sets.

## Mark up controls with attributes

These file types extend HTML and DITA. They use the `link`, `image`, `element`, `comment`, and `text` selectors with `url`, `attributes`, `src`, `precededBy`, `excludes`, `captures`, and `regex`. The HTML type also reads statements from an element's attribute, with an `inlineStatements.in` container and `value`. The steps are [`checkLink`](/docs/actions/checklink), [`goTo`](/docs/actions/goto), [`click`](/docs/actions/click), [`type`](/docs/actions/type), [`wait`](/docs/actions/wait), and [`find`](/docs/actions/find).

**`doc-detective.json (fileTypes, HTML entry)`**

```json title="doc-detective.json (fileTypes, HTML entry)"
{
  "extends": "html",
  "inlineStatements": {
    "in": [{ "element": { "tag": ["div"], "attributes": { "data-test": true } }, "value": "attributes.data-test" }]
  },
  "markup": [
    {
      "name": "goToUrl",
      "link": { "url": "^https?://", "precededBy": "\\b[Gg]o to\\s+$" },
      "captures": ["url"],
      "actions": ["goTo"]
    },
    {
      "name": "checkHyperlink",
      "link": { "url": "^https?://", "attributes": { "data-check": true }, "excludes": "^\\s*$" },
      "captures": ["url"],
      "actions": ["checkLink"]
    },
    {
      "name": "checkHostedImage",
      "image": { "src": "^https?://", "attributes": { "class": "(^|\\s)hosted(\\s|$)" }, "precededBy": "(?:^|>)\\s*$", "excludes": "^\\s*$" },
      "captures": ["src"],
      "actions": ["checkLink"]
    },
    {
      "name": "clickUiLabel",
      "element": { "tag": ["span", "ph"], "attributes": { "class": "(^|\\s)ui(\\s|$)" }, "precededBy": "\\b[Cc]lick\\s+$" },
      "actions": ["click"]
    },
    {
      "name": "waitComment",
      "comment": { "excludes": "\\bTODO\\b" },
      "regex": "^\\s*wait (\\d+)\\s*$",
      "actions": ["wait"]
    },
    {
      "name": "findEcho",
      "text": {},
      "regex": "\\bthe page shows (.+?) below the field",
      "actions": [{ "find": { "elementText": "$1", "timeout": 5000 } }]
    }
  ]
}
```

The DITA entry has the same `checkHostedImage`, `clickUiLabel`, `waitComment`, and `findEcho` definitions with `extends` set to `dita`. It has no `inlineStatements`, so DITA keeps its built-in `<data>` statements. DITA has no `link` nodes, so its links keep the built-in `<xref>` definitions.

#### Prose

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Echo text back</title></head>
<body>
<h1>Echo text back</h1>
<img src="http://localhost:8092/find-image-target.svg" alt="A target icon" class="hosted">
<ol>
  <li>Go to <a href="http://localhost:8092/type-echo.html" data-check>the type echo page</a>.</li>
  <li>Click <span class="ui">Type here:</span>.</li>
  <li>Type "Hello, Doc Detective".</li>
  <li>Check that the page shows Hello, Doc Detective below the field.</li>
</ol>
</body>
</html>
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="custom-html-attributes">
  <title>Echo text back</title>
  <taskbody>
    <context><image href="http://localhost:8092/find-image-target.svg" outputclass="hosted"><alt>A target icon</alt></image></context>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/type-echo.html" scope="external" format="html">the type echo page</xref>.</cmd></step>
      <step><cmd>Click <ph outputclass="ui">Type here:</ph>.</cmd></step>
      <step><cmd>Type "Hello, Doc Detective".</cmd></step>
      <step><cmd>Check that the page shows Hello, Doc Detective below the field.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Echo text back</title></head>
<body>
<div hidden data-test='test {"testId":"custom-html-attributes","detectSteps":true}'></div>
<h1>Echo text back</h1>
<img src="http://localhost:8092/find-image-target.svg" alt="A target icon" class="hosted">
<ol>
  <li>Go to <a href="http://localhost:8092/type-echo.html" data-check>the type echo page</a>.</li>
  <li>Click <span class="ui">Type here:</span>.</li>
  <li>Type "Hello, Doc Detective".<!-- wait 500 --></li>
  <li>Check that the page shows Hello, Doc Detective below the field.</li>
</ol>
<div hidden data-test="test end"></div>
</body>
</html>
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="custom-html-attributes">
  <title>Echo text back</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"custom-html-attributes","detectSteps":true}'/>
    <context><image href="http://localhost:8092/find-image-target.svg" outputclass="hosted"><alt>A target icon</alt></image></context>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/type-echo.html" scope="external" format="html">the type echo page</xref>.</cmd></step>
      <step><cmd>Click <ph outputclass="ui">Type here:</ph>.</cmd></step>
      <step><cmd>Type "Hello, Doc Detective".<!-- wait 500 --></cmd></step>
      <step><cmd>Check that the page shows Hello, Doc Detective below the field.</cmd></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Echo text back</title></head>
<body>
<!-- test {"testId":"custom-html-attributes","detectSteps":false} -->
<h1>Echo text back</h1>
<img src="http://localhost:8092/find-image-target.svg" alt="A target icon" class="hosted">
<!-- step {"checkLink":"http://localhost:8092/find-image-target.svg"} -->
<ol>
  <li>Go to <a href="http://localhost:8092/type-echo.html" data-check>the type echo page</a>.
    <!-- step {"goTo":"http://localhost:8092/type-echo.html"} --></li>
  <li>Click <span class="ui">Type here:</span>.
    <!-- step {"click":"Type here:"} --></li>
  <li>Type "Hello, Doc Detective".
    <!-- step {"type":"Hello, Doc Detective"} -->
    <!-- step {"wait":500} --></li>
  <li>Check that the page shows Hello, Doc Detective below the field.
    <!-- step {"find":{"elementText":"Hello, Doc Detective","timeout":5000}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="custom-html-attributes">
  <title>Echo text back</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"custom-html-attributes","detectSteps":false}'/>
    <context><image href="http://localhost:8092/find-image-target.svg" outputclass="hosted"><alt>A target icon</alt></image>
      <data name="doc-detective" value='step {"checkLink":"http://localhost:8092/find-image-target.svg"}'/></context>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/type-echo.html" scope="external" format="html">the type echo page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/></info></step>
      <step><cmd>Click <ph outputclass="ui">Type here:</ph>.</cmd>
        <info><data name="doc-detective" value='step {"click":"Type here:"}'/></info></step>
      <step><cmd>Type "Hello, Doc Detective".</cmd>
        <info><data name="doc-detective" value='step {"type":"Hello, Doc Detective"}'/>
          <data name="doc-detective" value='step {"wait":500}'/></info></step>
      <step><cmd>Check that the page shows Hello, Doc Detective below the field.</cmd>
        <info><data name="doc-detective" value='step {"find":{"elementText":"Hello, Doc Detective","timeout":5000}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-html-attributes",
      "steps": [
        {
          "checkLink": "http://localhost:8092/find-image-target.svg"
        },
        {
          "goTo": "http://localhost:8092/type-echo.html"
        },
        {
          "click": "Type here:"
        },
        {
          "type": "Hello, Doc Detective"
        },
        {
          "wait": 500
        },
        {
          "find": {
            "elementText": "Hello, Doc Detective",
            "timeout": 5000
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-html-attributes
    steps:
      - checkLink: http://localhost:8092/find-image-target.svg
      - goTo: http://localhost:8092/type-echo.html
      - click: "Type here:"
      - type: Hello, Doc Detective
      - wait: 500
      - find:
          elementText: Hello, Doc Detective
          timeout: 5000
```

### What detection finds

| Content                            | Definition                               | Detected step                           |
| ---------------------------------- | ---------------------------------------- | --------------------------------------- |
| An image with the `hosted` class   | `checkHostedImage`                       | `checkLink` the image's source          |
| `Go to <a data-check>`             | `goToUrl` and `checkHyperlink`, replaced | `goTo`, then `checkLink`                |
| `Go to <xref>`                     | Default `goToUrl` and `checkHyperlink`   | `goTo`, then `checkLink`                |
| `Click` and a `ui` label           | `clickUiLabel`                           | `click` the label's text                |
| `Type "…"`                         | Default `typeText`                       | `type`                                  |
| `<!-- wait 500 -->`                | `waitComment`                            | `wait` 500                              |
| `the page shows … below the field` | `findEcho`                               | `find` with `elementText` and `timeout` |

* One `attributes` pattern matches both formats. DITA's `outputclass` sets `class`, and an `<image>`'s `href` is its `src`.
* The replaced `checkHyperlink` checks only links an author marks with `data-check`, and skips links with no text. `"data-check": true` only requires the attribute.
* The replaced `goToUrl` sits before `checkHyperlink`, so the `goTo` still comes before the `checkLink` for the same link. Your definitions run before the built-in ones, in the order you list them.
* `checkHostedImage` skips decorative images, whose alt text is empty, and images inside a sentence. Its `precededBy` matches only when nothing but a tag comes before the image in its block.
* `waitComment` skips comments that say `TODO`, so a note about a wait to add later doesn't become a step.
* The `wait 500` comment isn't visible to readers, so the detected variants carry it where the prose has nothing. It's the detected counterpart of a `step` statement.
* In HTML, the hidden `<div data-test>` elements hold the `test` and `test end` statements, for sites whose build strips comments.
* These formats leave out Markdown, MDX, AsciiDoc, and reStructuredText. Their links and images don't carry a `class` attribute in the same way, and AsciiDoc and reStructuredText produce no `element` nodes.

## Define a plain-text format

This file type has no `extends`. Its `name` and `extensions` define a format for `.txt` files. Its `inlineStatements` use the regex statement keys `testStart`, `testEnd`, `ignoreStart`, `ignoreEnd`, and `step`, each with one pattern as a string. Its `includeStatements` pattern pulls in a shared file, and its `markup` uses regex definitions. The steps are [`checkLink`](/docs/actions/checklink) and [`httpRequest`](/docs/actions/httprequest).

**`doc-detective.json (fileTypes)`**

```json title="doc-detective.json (fileTypes)"
{
  "fileTypes": [
    {
      "name": "plain-text",
      "extensions": ["txt"],
      "inlineStatements": {
        "testStart": "(?:^|\\n)[ \\t]*TEST (\\{.*\\})",
        "testEnd": "(?:^|\\n)[ \\t]*END TEST",
        "ignoreStart": "(?:^|\\n)[ \\t]*IGNORE START",
        "ignoreEnd": "(?:^|\\n)[ \\t]*IGNORE END",
        "step": "(?:^|\\n)[ \\t]*STEP (\\{.*\\})"
      },
      "includeStatements": "^[ \\t]*INCLUDE (\\S+)[ \\t]*$",
      "markup": [
        {
          "name": "checkUrl",
          "regex": ["\\b[Cc]heck that (https?://\\S+) responds\\b"],
          "actions": ["checkLink"]
        },
        {
          "name": "sendRequest",
          "regex": ["\\bSend an? (GET|POST|PUT|PATCH|DELETE) request to (https?://\\S+) with the body (\\{.*\\})\\.(?=\\s|$)"],
          "actions": [{ "httpRequest": { "method": "$1", "url": "$2", "request": { "body": "$3" } } }]
        }
      ]
    },
    "markdown",
    "asciidoc",
    "html",
    "dita",
    "rst"
  ]
}
```

#### Prose

#### Plain text

**`prose.txt`**

```text title="prose.txt"
Create a user with the echo API

INCLUDE prerequisites.txt

1. Send a POST request to http://localhost:8092/api/users with the body {"name":"Ada"}.
   The API returns the user it created.

To remove a user later, send a request like this one. Don't run it against
data you want to keep.
   Send a DELETE request to http://localhost:8092/api/users/1 with the body {"confirm":true}.
```

#### Detected

#### Plain text

**`detected.txt`**

```text title="detected.txt"
TEST {"testId":"custom-plain-text","detectSteps":true}

Create a user with the echo API

INCLUDE prerequisites.txt

1. Send a POST request to http://localhost:8092/api/users with the body {"name":"Ada"}.
   The API returns the user it created.

IGNORE START
To remove a user later, send a request like this one. Don't run it against
data you want to keep.
   Send a DELETE request to http://localhost:8092/api/users/1 with the body {"confirm":true}.
IGNORE END

END TEST
```

#### Inline

#### Plain text

**`inline.txt`**

```text title="inline.txt"
TEST {"testId":"custom-plain-text","detectSteps":false}

Create a user with the echo API

INCLUDE prerequisites.txt
STEP {"checkLink":"http://localhost:8092/api/users"}

1. Send a POST request to http://localhost:8092/api/users with the body {"name":"Ada"}.
   STEP {"httpRequest":{"method":"post","url":"http://localhost:8092/api/users","request":{"body":{"name":"Ada"}},"response":{"body":{"name":"Ada"}}}}
   The API returns the user it created.

To remove a user later, send a request like this one. Don't run it against
data you want to keep.
   Send a DELETE request to http://localhost:8092/api/users/1 with the body {"confirm":true}.

END TEST
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-plain-text",
      "steps": [
        {
          "checkLink": "http://localhost:8092/api/users"
        },
        {
          "httpRequest": {
            "method": "post",
            "url": "http://localhost:8092/api/users",
            "request": {
              "body": {
                "name": "Ada"
              }
            },
            "response": {
              "body": {
                "name": "Ada"
              }
            }
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-plain-text
    steps:
      - checkLink: http://localhost:8092/api/users
      - httpRequest:
          method: post
          url: http://localhost:8092/api/users
          request:
            body:
              name: Ada
          response:
            body:
              name: Ada
```

### What detection finds

* No parser handles `.txt`, so this format can't use selectors. Regex definitions match the file's raw text.
* Regex patterns run without flags, so `^` matches only the start of the file. `(?:^|\n)` matches the start of any line.
* `checkUrl` uses the `checkLink` action name, which takes `$1`. `sendRequest` is a step template with three groups. A request body that's a JSON object becomes an object, not a string.
* The inline and standalone variants also check the response body. A detected step has only what the definition's template sets.
* `INCLUDE prerequisites.txt` pulls in a shared file from the same folder, which holds one line: `Before you start, check that http://localhost:8092/api/users responds.` Doc Detective includes it before it detects steps, so `checkUrl` finds the `checkLink` there. Includes need `resolveIncludes`, which is on by default. `^` and `$` in `includeStatements` match at line boundaries.
* `IGNORE START` and `IGNORE END` wrap the `DELETE` example, so detection skips a request the procedure only describes.
* The inline variant uses the format's own `TEST`, `STEP`, and `END TEST` lines, so it needs this config too. The other examples' inline variants use the built-in statement syntax.

## Keep statements in markup your site keeps

Some publishing pipelines strip HTML comments, so statements in comments never reach the published source. This Markdown file type reads statements from other markup instead. Its regex statement keys, `testStart`, `testEnd`, `ignoreStart`, `ignoreEnd`, and `step`, each take a list of patterns. Its `inlineStatements.in` list has one container of each selector kind: `comment`, `codeBlock`, `link`, `image`, `strong`, `emphasis`, `text`, and `element`. Its `markup` runs code blocks with [`runShell`](/docs/actions/runshell), with `codeBlock` in its string form and with `metaExcludes`. The other steps are [`goTo`](/docs/actions/goto), [`find`](/docs/actions/find), [`click`](/docs/actions/click), [`type`](/docs/actions/type), [`wait`](/docs/actions/wait), and [`checkLink`](/docs/actions/checklink).

**`doc-detective.json (fileTypes)`**

```json title="doc-detective.json (fileTypes)"
{
  "fileTypes": [
    {
      "name": "markdown-statements",
      "extends": "markdown",
      "inlineStatements": {
        "testStart": ["<!--\\s*dd-test\\s+(\\{[\\s\\S]*?\\})\\s*-->", "<!--\\s*doc-detective-test\\s+(\\{[\\s\\S]*?\\})\\s*-->"],
        "testEnd": ["<!--\\s*dd-end\\s*-->", "<!--\\s*doc-detective-end\\s*-->"],
        "ignoreStart": ["<!--\\s*dd-skip\\s*-->", "<!--\\s*doc-detective-skip\\s*-->"],
        "ignoreEnd": ["<!--\\s*dd-resume\\s*-->", "<!--\\s*doc-detective-resume\\s*-->"],
        "step": ["<!--\\s*dd-step\\s+(\\{[\\s\\S]*?\\})\\s*-->", "<!--\\s*doc-detective-step\\s+(\\{[\\s\\S]*?\\})\\s*-->"],
        "in": [
          "comment",
          { "comment": { "excludes": "^\\s*draft\\b" }, "regex": ["^dd:\\s*([\\s\\S]*)$", "^doc-detective:\\s*([\\s\\S]*)$"] },
          { "codeBlock": "dd" },
          { "codeBlock": { "language": ["doc-detective"], "metaExcludes": "\\bdraft\\b", "excludes": "^\\s*$" } },
          { "link": { "url": "^#dd$", "attributes": { "class": "^dd$" }, "precededBy": "^\\s*$", "excludes": "\\S" }, "value": "title" },
          { "image": { "src": "^#dd$", "attributes": { "class": "^dd$" }, "precededBy": "^\\s*$", "excludes": "^\\s*$" } },
          { "strong": { "precededBy": "\\bTest:\\s*$", "excludes": "^\\s*$" } },
          { "emphasis": { "precededBy": "\\bTest:\\s*$", "excludes": "^\\s*$" } },
          { "text": { "excludes": "^(?!\\s*Test step:)" }, "regex": "^\\s*Test step:\\s*(step\\b[\\s\\S]*)$" },
          { "element": "dd-statement" },
          { "element": { "tag": ["span"], "precededBy": "^\\s*$", "excludes": "\\S" }, "value": "attributes.data-dd" }
        ]
      },
      "markup": [
        { "name": "runCode", "codeBlock": "bash", "actions": ["runShell"] },
        {
          "name": "runShellUnlessNoRun",
          "codeBlock": { "language": ["sh", "shell"], "metaExcludes": "\\bno-run\\b" },
          "actions": ["runShell"]
        },
        { "name": "findOnscreenText", "strong": { "excludes": "^(?:step|test)\\b" }, "actions": ["find"] }
      ]
    },
    "asciidoc",
    "html",
    "dita",
    "rst"
  ]
}
```

This example uses every container at once so you can compare them. A real project picks the one or two its pipeline keeps.

#### Prose

#### Markdown

**`prose.md`**

````markdown title="prose.md"
# Echo text back

Check that the page server is up:

```bash
curl -sf http://localhost:8092/type-echo.html > /dev/null
```

Open the type echo page at `http://localhost:8092/type-echo.html`.

Click the field labeled Type here:, then type Hello, Doc Detective.

The field echoes each keystroke, so the page shows Hello, Doc Detective below the field.

Older versions of the page echoed only after you pressed Enter.

If the page doesn't load, restart the page server from the repository root:

```sh no-run
node test/server/start.js
```
````

#### Detected

#### Markdown

**`detected.md`**

````markdown title="detected.md"
<!-- dd-test {"testId":"custom-statement-syntax","detectSteps":true} -->

# Echo text back

Check that the page server is up:

```bash
curl -sf http://localhost:8092/type-echo.html > /dev/null
```

Open the type echo page at `http://localhost:8092/type-echo.html`.

```dd
step {"goTo":"http://localhost:8092/type-echo.html"}
```

[](#dd 'step {"find":"Type Echo Test Page"}'){.dd}

Click the field labeled Type here:, then type Hello, Doc Detective.

![step {"click":"Type here:"}](#dd){.dd}

<dd-statement>step {"type":"Hello, Doc Detective"}</dd-statement>

The field echoes each keystroke, so the page shows Hello, Doc Detective below the field.

<span data-dd='step {"wait":200}'></span>

Test step: step {"find":"Hello, Doc Detective"}

Test: **step {"find":{"selector":"#echo","elementText":"Hello, Doc Detective"}}**

Test: _step {"checkLink":"http://localhost:8092/type-echo.html"}_

<!-- dd: step {"find":"Type here:"} -->

```doc-detective
step {"find":{"selector":"#type-input"}}
```

```doc-detective draft
step {"find":"Goodbye"}
```

<!-- dd-step {"find":{"selector":"#echo"}} -->

Older versions of the page echoed only after you pressed Enter.

<!-- dd-skip -->

```dd
step {"type":"$ENTER$"}
```

<!-- doc-detective-resume -->

<!-- doc-detective-step {"find":"Type Echo Test Page"} -->

If the page doesn't load, restart the page server from the repository root:

```sh no-run
node test/server/start.js
```

<!-- doc-detective-end -->
````

#### Inline

#### Markdown

**`inline.md`**

````markdown title="inline.md"
<!-- test {"testId":"custom-statement-syntax","detectSteps":false} -->

# Echo text back

Check that the page server is up:

```bash
curl -sf http://localhost:8092/type-echo.html > /dev/null
```

<!-- step {"runShell":"curl -sf http://localhost:8092/type-echo.html > /dev/null"} -->

Open the type echo page at `http://localhost:8092/type-echo.html`.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<!-- step {"find":"Type Echo Test Page"} -->

Click the field labeled Type here:, then type Hello, Doc Detective.

<!-- step {"click":"Type here:"} -->
<!-- step {"type":"Hello, Doc Detective"} -->

The field echoes each keystroke, so the page shows Hello, Doc Detective below the field.

<!-- step {"wait":200} -->
<!-- step {"find":{"selector":"#echo","elementText":"Hello, Doc Detective"}} -->

Older versions of the page echoed only after you pressed Enter.

If the page doesn't load, restart the page server from the repository root:

```sh no-run
node test/server/start.js
```

<!-- test end -->
````

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-statement-syntax",
      "steps": [
        {
          "runShell": "curl -sf http://localhost:8092/type-echo.html > /dev/null"
        },
        {
          "goTo": "http://localhost:8092/type-echo.html"
        },
        {
          "find": "Type Echo Test Page"
        },
        {
          "click": "Type here:"
        },
        {
          "type": "Hello, Doc Detective"
        },
        {
          "wait": 200
        },
        {
          "find": {
            "selector": "#echo",
            "elementText": "Hello, Doc Detective"
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-statement-syntax
    steps:
      - runShell: curl -sf http://localhost:8092/type-echo.html > /dev/null
      - goTo: http://localhost:8092/type-echo.html
      - find: Type Echo Test Page
      - click: "Type here:"
      - type: Hello, Doc Detective
      - wait: 200
      - find:
          selector: "#echo"
          elementText: Hello, Doc Detective
```

### What detection finds

| Markup in `detected.md`                                        | Read by                                            | Step                                     |
| -------------------------------------------------------------- | -------------------------------------------------- | ---------------------------------------- |
| A `bash` code block                                            | `runCode` markup, replaced                         | `runShell` the block                     |
| A `dd` code block                                              | `{ "codeBlock": "dd" }`                            | `goTo`                                   |
| `[](#dd '…'){.dd}`, a link with no text                        | `link` container, `value: "title"`                 | `find`                                   |
| `![…](#dd){.dd}`, an image                                     | `image` container, the alt text                    | `click`                                  |
| `<dd-statement>…</dd-statement>`                               | `{ "element": "dd-statement" }`                    | `type`                                   |
| `<span data-dd='…'></span>`                                    | `element` container, `value: "attributes.data-dd"` | `wait`                                   |
| `Test step: step {…}`                                          | `text` container with `regex`                      | `find`                                   |
| `Test: **step {…}**`                                           | `strong` container                                 | `find` with `selector` and `elementText` |
| `Test: _step {…}_`                                             | `emphasis` container                               | `checkLink`                              |
| `<!-- dd: step {…} -->`                                        | `comment` container with `regex`                   | `find`                                   |
| A `doc-detective` code block                                   | `codeBlock` container with `language`              | `find`                                   |
| A `doc-detective draft` code block                             | None. `metaExcludes` skips it                      | None                                     |
| `<!-- dd-step {…} -->` and `<!-- doc-detective-step {…} -->`   | `step` patterns                                    | `find`                                   |
| A `dd` code block between `dd-skip` and `doc-detective-resume` | None. The ignore patterns skip it                  | None                                     |
| An `sh no-run` code block                                      | None. `metaExcludes` skips it                      | None                                     |

* Each regex statement key lists two patterns, one for the older `dd-` keywords and one for the newer `doc-detective-` keywords. Files that use either work while a project moves between them. An ignored section can start with one keyword and end with the other.
* A container's `value` names the field that holds the statement. Without `value`, the statement is the node's main text: a code block's content, an image's alt text, or an element's content.
* A container's options narrow it like a selector's do. `precededBy: "^\\s*$"` takes only a node that starts its block. `excludes: "\\S"` takes only a link or `<span>` with no visible text. `"class": "^dd$"` takes only markup with the `dd` class, which the site can hide.
* The text container's `excludes` skips every prose run that doesn't start with `Test step:`, and its `regex` keeps the statement after the label.
* The replaced `findOnscreenText` skips bold text that starts with `step` or `test`, so the bold statement doesn't also become a `find` of its own text.
* `"comment"` as a string reads every comment. The built-in Markdown file type has it too. The inline variant's plain `test` comments therefore work with this config and with the default one.
* The `bash` definition's `name` is `runCode`, so it replaces the built-in `runCode` definition. A `bash` block then runs as a `runShell` step and isn't marked `unsafe`.
* This example is Markdown only. MDX reads `{.dd}` as a JavaScript expression, so it needs JSX attributes instead, and the other formats write links, images, and elements their own ways.

## Selector kind permutations

Each example detects steps with one selector kind and no selector options. Its file types don't use `extends`, so no built-in definition adds steps. `step` statements open the page where the procedure needs it. Each definition below is the one entry in `markup`, and the config repeats it in one file type per format. An example leaves out the formats that don't produce its kind.

### `comment`

**Varies:** `markup.comment` · **Value:** `{}` · **Effect:** every comment is a candidate, and `regex` picks the ones that start with `expect:`.

```json
{
  "name": "findExpected",
  "comment": {},
  "regex": "^\\s*expect:\\s*(.+?)\\s*$",
  "actions": [
    "find"
  ]
}
```

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Check the page heading

Open the type echo page.

The heading names the page.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Check the page heading

Open the type echo page.

The heading names the page.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Check the page heading

Open the type echo page.

The heading names the page.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the page heading</title></head>
<body>
<h1>Check the page heading</h1>
<p>Open the type echo page.</p>
<p>The heading names the page.</p>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Check the page heading
======================

Open the type echo page.

The heading names the page.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-kind-comment">
  <title>Check the page heading</title>
  <body>
    <p>Open the type echo page.</p>
    <p>The heading names the page.</p>
  </body>
</topic>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"custom-kind-comment","detectSteps":true} -->

# Check the page heading

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

The heading names the page.

<!-- expect: Type Echo Test Page -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"custom-kind-comment","detectSteps":true} */}

# Check the page heading

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

The heading names the page.

{/* expect: Type Echo Test Page */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Check the page heading

// (test {"testId":"custom-kind-comment","detectSteps":true})

Open the type echo page.

// (step {"goTo":"http://localhost:8092/type-echo.html"})

The heading names the page.

// expect: Type Echo Test Page

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the page heading</title></head>
<body>
<!-- test {"testId":"custom-kind-comment","detectSteps":true} -->
<h1>Check the page heading</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>The heading names the page.</p>
<!-- expect: Type Echo Test Page -->
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Check the page heading
======================

.. test {"testId":"custom-kind-comment","detectSteps":true}

Open the type echo page.

.. step {"goTo":"http://localhost:8092/type-echo.html"}

The heading names the page.

.. expect: Type Echo Test Page

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-kind-comment">
  <title>Check the page heading</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-kind-comment","detectSteps":true}'/>
    <p>Open the type echo page.</p>
    <data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/>
    <p>The heading names the page.</p>
    <!-- expect: Type Echo Test Page -->
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"custom-kind-comment","detectSteps":false} -->

# Check the page heading

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

The heading names the page.

<!-- step {"find":"Type Echo Test Page"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"custom-kind-comment","detectSteps":false} */}

# Check the page heading

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

The heading names the page.

{/* step {"find":"Type Echo Test Page"} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Check the page heading

// (test {"testId":"custom-kind-comment","detectSteps":false})

Open the type echo page.

// (step {"goTo":"http://localhost:8092/type-echo.html"})

The heading names the page.

// (step {"find":"Type Echo Test Page"})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the page heading</title></head>
<body>
<!-- test {"testId":"custom-kind-comment","detectSteps":false} -->
<h1>Check the page heading</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>The heading names the page.</p>
<!-- step {"find":"Type Echo Test Page"} -->
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Check the page heading
======================

.. test {"testId":"custom-kind-comment","detectSteps":false}

Open the type echo page.

.. step {"goTo":"http://localhost:8092/type-echo.html"}

The heading names the page.

.. step {"find":"Type Echo Test Page"}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-kind-comment">
  <title>Check the page heading</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-kind-comment","detectSteps":false}'/>
    <p>Open the type echo page.</p>
    <data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/>
    <p>The heading names the page.</p>
    <data name="doc-detective" value='step {"find":"Type Echo Test Page"}'/>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-kind-comment",
      "steps": [
        {
          "goTo": "http://localhost:8092/type-echo.html"
        },
        {
          "find": "Type Echo Test Page"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-kind-comment
    steps:
      - goTo: http://localhost:8092/type-echo.html
      - find: Type Echo Test Page
```

The `expect:` comment is in the detected variants only. A bare `comment: {}` would also match the `test` and `step` comments, so a comment definition needs `regex`.

### `codeBlock`

**Varies:** `markup.codeBlock` · **Value:** `{}` · **Effect:** every code block runs, whatever its language.

```json
{
  "name": "runBlock",
  "codeBlock": {},
  "actions": [
    "runShell"
  ]
}
```

#### Prose

#### Markdown

**`prose.md`**

````markdown title="prose.md"
# Check that the page server is up

Request the type echo page. The command fails if the server doesn't answer:

```bash
curl -sf -o /dev/null http://localhost:8092/type-echo.html
```
````

#### MDX

**`prose.mdx`**

````mdx title="prose.mdx"
# Check that the page server is up

Request the type echo page. The command fails if the server doesn't answer:

```bash
curl -sf -o /dev/null http://localhost:8092/type-echo.html
```
````

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Check that the page server is up

Request the type echo page. The command fails if the server doesn't answer:

[source,bash]
----
curl -sf -o /dev/null http://localhost:8092/type-echo.html
----
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check that the page server is up</title></head>
<body>
<h1>Check that the page server is up</h1>
<p>Request the type echo page. The command fails if the server doesn't answer:</p>
<pre><code class="language-bash">curl -sf -o /dev/null http://localhost:8092/type-echo.html</code></pre>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Check that the page server is up
================================

Request the type echo page. The command fails if the server doesn't answer:

.. code-block:: bash

   curl -sf -o /dev/null http://localhost:8092/type-echo.html
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-kind-codeblock">
  <title>Check that the page server is up</title>
  <body>
    <p>Request the type echo page. The command fails if the server doesn't answer:</p>
    <codeblock outputclass="language-bash">curl -sf -o /dev/null http://localhost:8092/type-echo.html</codeblock>
  </body>
</topic>
```

#### Detected

#### Markdown

**`detected.md`**

````markdown title="detected.md"
<!-- test {"testId":"custom-kind-codeblock","detectSteps":true} -->

# Check that the page server is up

Request the type echo page. The command fails if the server doesn't answer:

```bash
curl -sf -o /dev/null http://localhost:8092/type-echo.html
```

<!-- test end -->
````

#### MDX

**`detected.mdx`**

````mdx title="detected.mdx"
{/* test {"testId":"custom-kind-codeblock","detectSteps":true} */}

# Check that the page server is up

Request the type echo page. The command fails if the server doesn't answer:

```bash
curl -sf -o /dev/null http://localhost:8092/type-echo.html
```

{/* test end */}
````

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Check that the page server is up

// (test {"testId":"custom-kind-codeblock","detectSteps":true})

Request the type echo page. The command fails if the server doesn't answer:

[source,bash]
----
curl -sf -o /dev/null http://localhost:8092/type-echo.html
----

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check that the page server is up</title></head>
<body>
<!-- test {"testId":"custom-kind-codeblock","detectSteps":true} -->
<h1>Check that the page server is up</h1>
<p>Request the type echo page. The command fails if the server doesn't answer:</p>
<pre><code class="language-bash">curl -sf -o /dev/null http://localhost:8092/type-echo.html</code></pre>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Check that the page server is up
================================

.. test {"testId":"custom-kind-codeblock","detectSteps":true}

Request the type echo page. The command fails if the server doesn't answer:

.. code-block:: bash

   curl -sf -o /dev/null http://localhost:8092/type-echo.html

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-kind-codeblock">
  <title>Check that the page server is up</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-kind-codeblock","detectSteps":true}'/>
    <p>Request the type echo page. The command fails if the server doesn't answer:</p>
    <codeblock outputclass="language-bash">curl -sf -o /dev/null http://localhost:8092/type-echo.html</codeblock>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Inline

#### Markdown

**`inline.md`**

````markdown title="inline.md"
<!-- test {"testId":"custom-kind-codeblock","detectSteps":false} -->

# Check that the page server is up

Request the type echo page. The command fails if the server doesn't answer:

```bash
curl -sf -o /dev/null http://localhost:8092/type-echo.html
```

<!-- step {"runShell":"curl -sf -o /dev/null http://localhost:8092/type-echo.html"} -->

<!-- test end -->
````

#### MDX

**`inline.mdx`**

````mdx title="inline.mdx"
{/* test {"testId":"custom-kind-codeblock","detectSteps":false} */}

# Check that the page server is up

Request the type echo page. The command fails if the server doesn't answer:

```bash
curl -sf -o /dev/null http://localhost:8092/type-echo.html
```

{/* step {"runShell":"curl -sf -o /dev/null http://localhost:8092/type-echo.html"} */}

{/* test end */}
````

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Check that the page server is up

// (test {"testId":"custom-kind-codeblock","detectSteps":false})

Request the type echo page. The command fails if the server doesn't answer:

[source,bash]
----
curl -sf -o /dev/null http://localhost:8092/type-echo.html
----

// (step {"runShell":"curl -sf -o /dev/null http://localhost:8092/type-echo.html"})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check that the page server is up</title></head>
<body>
<!-- test {"testId":"custom-kind-codeblock","detectSteps":false} -->
<h1>Check that the page server is up</h1>
<p>Request the type echo page. The command fails if the server doesn't answer:</p>
<pre><code class="language-bash">curl -sf -o /dev/null http://localhost:8092/type-echo.html</code></pre>
<!-- step {"runShell":"curl -sf -o /dev/null http://localhost:8092/type-echo.html"} -->
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Check that the page server is up
================================

.. test {"testId":"custom-kind-codeblock","detectSteps":false}

Request the type echo page. The command fails if the server doesn't answer:

.. code-block:: bash

   curl -sf -o /dev/null http://localhost:8092/type-echo.html

.. step {"runShell":"curl -sf -o /dev/null http://localhost:8092/type-echo.html"}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-kind-codeblock">
  <title>Check that the page server is up</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-kind-codeblock","detectSteps":false}'/>
    <p>Request the type echo page. The command fails if the server doesn't answer:</p>
    <codeblock outputclass="language-bash">curl -sf -o /dev/null http://localhost:8092/type-echo.html</codeblock>
    <data name="doc-detective" value='step {"runShell":"curl -sf -o /dev/null http://localhost:8092/type-echo.html"}'/>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-kind-codeblock",
      "steps": [
        {
          "runShell": "curl -sf -o /dev/null http://localhost:8092/type-echo.html"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-kind-codeblock
    steps:
      - runShell: curl -sf -o /dev/null http://localhost:8092/type-echo.html
```

### `link`

**Varies:** `markup.link` · **Value:** `{}` · **Effect:** each link's text, its main text, becomes `$1`.

```json
{
  "name": "findLinkText",
  "link": {},
  "actions": [
    "find"
  ]
}
```

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Check the page heading

Open the type echo page.

The page's heading is [Type Echo Test Page](http://localhost:8092/type-echo.html).
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Check the page heading

Open the type echo page.

The page's heading is [Type Echo Test Page](http://localhost:8092/type-echo.html).
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Check the page heading

Open the type echo page.

The page's heading is http://localhost:8092/type-echo.html[Type Echo Test Page].
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the page heading</title></head>
<body>
<h1>Check the page heading</h1>
<p>Open the type echo page.</p>
<p>The page's heading is <a href="http://localhost:8092/type-echo.html">Type Echo Test Page</a>.</p>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Check the page heading
======================

Open the type echo page.

The page's heading is `Type Echo Test Page <http://localhost:8092/type-echo.html>`__.
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"custom-kind-link","detectSteps":true} -->

# Check the page heading

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

The page's heading is [Type Echo Test Page](http://localhost:8092/type-echo.html).

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"custom-kind-link","detectSteps":true} */}

# Check the page heading

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

The page's heading is [Type Echo Test Page](http://localhost:8092/type-echo.html).

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Check the page heading

// (test {"testId":"custom-kind-link","detectSteps":true})

Open the type echo page.

// (step {"goTo":"http://localhost:8092/type-echo.html"})

The page's heading is http://localhost:8092/type-echo.html[Type Echo Test Page].

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the page heading</title></head>
<body>
<!-- test {"testId":"custom-kind-link","detectSteps":true} -->
<h1>Check the page heading</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>The page's heading is <a href="http://localhost:8092/type-echo.html">Type Echo Test Page</a>.</p>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Check the page heading
======================

.. test {"testId":"custom-kind-link","detectSteps":true}

Open the type echo page.

.. step {"goTo":"http://localhost:8092/type-echo.html"}

The page's heading is `Type Echo Test Page <http://localhost:8092/type-echo.html>`__.

.. test end
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"custom-kind-link","detectSteps":false} -->

# Check the page heading

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

The page's heading is [Type Echo Test Page](http://localhost:8092/type-echo.html).

<!-- step {"find":"Type Echo Test Page"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"custom-kind-link","detectSteps":false} */}

# Check the page heading

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

The page's heading is [Type Echo Test Page](http://localhost:8092/type-echo.html).

{/* step {"find":"Type Echo Test Page"} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Check the page heading

// (test {"testId":"custom-kind-link","detectSteps":false})

Open the type echo page.

// (step {"goTo":"http://localhost:8092/type-echo.html"})

The page's heading is http://localhost:8092/type-echo.html[Type Echo Test Page].

// (step {"find":"Type Echo Test Page"})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the page heading</title></head>
<body>
<!-- test {"testId":"custom-kind-link","detectSteps":false} -->
<h1>Check the page heading</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>The page's heading is <a href="http://localhost:8092/type-echo.html">Type Echo Test Page</a>.</p>
<!-- step {"find":"Type Echo Test Page"} -->
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Check the page heading
======================

.. test {"testId":"custom-kind-link","detectSteps":false}

Open the type echo page.

.. step {"goTo":"http://localhost:8092/type-echo.html"}

The page's heading is `Type Echo Test Page <http://localhost:8092/type-echo.html>`__.

.. step {"find":"Type Echo Test Page"}

.. test end
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-kind-link",
      "steps": [
        {
          "goTo": "http://localhost:8092/type-echo.html"
        },
        {
          "find": "Type Echo Test Page"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-kind-link
    steps:
      - goTo: http://localhost:8092/type-echo.html
      - find: Type Echo Test Page
```

DITA has no `link` nodes, so this example leaves it out. Select `<xref>` as an `element` instead.

### `image`

**Varies:** `markup.image` · **Value:** `{}` · **Effect:** every image matches, and `captures` uses its source.

```json
{
  "name": "checkImage",
  "image": {},
  "captures": [
    "src"
  ],
  "actions": [
    "checkLink"
  ]
}
```

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Check a hosted icon

The page uses this icon:

![Target icon](http://localhost:8092/find-image-target.svg)
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Check a hosted icon

The page uses this icon:

![Target icon](http://localhost:8092/find-image-target.svg)
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Check a hosted icon

The page uses this icon:

image::http://localhost:8092/find-image-target.svg[Target icon]
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check a hosted icon</title></head>
<body>
<h1>Check a hosted icon</h1>
<p>The page uses this icon:</p>
<p><img src="http://localhost:8092/find-image-target.svg" alt="Target icon"></p>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Check a hosted icon
===================

The page uses this icon:

.. image:: http://localhost:8092/find-image-target.svg
   :alt: Target icon
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-kind-image">
  <title>Check a hosted icon</title>
  <body>
    <p>The page uses this icon:</p>
    <image href="http://localhost:8092/find-image-target.svg"><alt>Target icon</alt></image>
  </body>
</topic>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"custom-kind-image","detectSteps":true} -->

# Check a hosted icon

The page uses this icon:

![Target icon](http://localhost:8092/find-image-target.svg)

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"custom-kind-image","detectSteps":true} */}

# Check a hosted icon

The page uses this icon:

![Target icon](http://localhost:8092/find-image-target.svg)

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Check a hosted icon

// (test {"testId":"custom-kind-image","detectSteps":true})

The page uses this icon:

image::http://localhost:8092/find-image-target.svg[Target icon]

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check a hosted icon</title></head>
<body>
<!-- test {"testId":"custom-kind-image","detectSteps":true} -->
<h1>Check a hosted icon</h1>
<p>The page uses this icon:</p>
<p><img src="http://localhost:8092/find-image-target.svg" alt="Target icon"></p>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Check a hosted icon
===================

.. test {"testId":"custom-kind-image","detectSteps":true}

The page uses this icon:

.. image:: http://localhost:8092/find-image-target.svg
   :alt: Target icon

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-kind-image">
  <title>Check a hosted icon</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-kind-image","detectSteps":true}'/>
    <p>The page uses this icon:</p>
    <image href="http://localhost:8092/find-image-target.svg"><alt>Target icon</alt></image>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"custom-kind-image","detectSteps":false} -->

# Check a hosted icon

The page uses this icon:

![Target icon](http://localhost:8092/find-image-target.svg)

<!-- step {"checkLink":"http://localhost:8092/find-image-target.svg"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"custom-kind-image","detectSteps":false} */}

# Check a hosted icon

The page uses this icon:

![Target icon](http://localhost:8092/find-image-target.svg)

{/* step {"checkLink":"http://localhost:8092/find-image-target.svg"} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Check a hosted icon

// (test {"testId":"custom-kind-image","detectSteps":false})

The page uses this icon:

image::http://localhost:8092/find-image-target.svg[Target icon]

// (step {"checkLink":"http://localhost:8092/find-image-target.svg"})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check a hosted icon</title></head>
<body>
<!-- test {"testId":"custom-kind-image","detectSteps":false} -->
<h1>Check a hosted icon</h1>
<p>The page uses this icon:</p>
<p><img src="http://localhost:8092/find-image-target.svg" alt="Target icon"></p>
<!-- step {"checkLink":"http://localhost:8092/find-image-target.svg"} -->
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Check a hosted icon
===================

.. test {"testId":"custom-kind-image","detectSteps":false}

The page uses this icon:

.. image:: http://localhost:8092/find-image-target.svg
   :alt: Target icon

.. step {"checkLink":"http://localhost:8092/find-image-target.svg"}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-kind-image">
  <title>Check a hosted icon</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-kind-image","detectSteps":false}'/>
    <p>The page uses this icon:</p>
    <image href="http://localhost:8092/find-image-target.svg"><alt>Target icon</alt></image>
    <data name="doc-detective" value='step {"checkLink":"http://localhost:8092/find-image-target.svg"}'/>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-kind-image",
      "steps": [
        {
          "checkLink": "http://localhost:8092/find-image-target.svg"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-kind-image
    steps:
      - checkLink: http://localhost:8092/find-image-target.svg
```

Without `captures`, `$1` is the image's alt text.

### `strong`

**Varies:** `markup.strong` · **Value:** `{}` · **Effect:** every bold phrase becomes a `find`.

```json
{
  "name": "findBold",
  "strong": {},
  "actions": [
    "find"
  ]
}
```

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Check the field label

Open the type echo page.

The field is labeled **Type here:**.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Check the field label

Open the type echo page.

The field is labeled **Type here:**.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Check the field label

Open the type echo page.

The field is labeled *Type here:*.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the field label</title></head>
<body>
<h1>Check the field label</h1>
<p>Open the type echo page.</p>
<p>The field is labeled <strong>Type here:</strong>.</p>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Check the field label
=====================

Open the type echo page.

The field is labeled **Type here:**.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-kind-strong">
  <title>Check the field label</title>
  <body>
    <p>Open the type echo page.</p>
    <p>The field is labeled <b>Type here:</b>.</p>
  </body>
</topic>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"custom-kind-strong","detectSteps":true} -->

# Check the field label

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

The field is labeled **Type here:**.

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"custom-kind-strong","detectSteps":true} */}

# Check the field label

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

The field is labeled **Type here:**.

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Check the field label

// (test {"testId":"custom-kind-strong","detectSteps":true})

Open the type echo page.

// (step {"goTo":"http://localhost:8092/type-echo.html"})

The field is labeled *Type here:*.

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the field label</title></head>
<body>
<!-- test {"testId":"custom-kind-strong","detectSteps":true} -->
<h1>Check the field label</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>The field is labeled <strong>Type here:</strong>.</p>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Check the field label
=====================

.. test {"testId":"custom-kind-strong","detectSteps":true}

Open the type echo page.

.. step {"goTo":"http://localhost:8092/type-echo.html"}

The field is labeled **Type here:**.

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-kind-strong">
  <title>Check the field label</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-kind-strong","detectSteps":true}'/>
    <p>Open the type echo page.</p>
    <data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/>
    <p>The field is labeled <b>Type here:</b>.</p>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"custom-kind-strong","detectSteps":false} -->

# Check the field label

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

The field is labeled **Type here:**.

<!-- step {"find":"Type here:"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"custom-kind-strong","detectSteps":false} */}

# Check the field label

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

The field is labeled **Type here:**.

{/* step {"find":"Type here:"} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Check the field label

// (test {"testId":"custom-kind-strong","detectSteps":false})

Open the type echo page.

// (step {"goTo":"http://localhost:8092/type-echo.html"})

The field is labeled *Type here:*.

// (step {"find":"Type here:"})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the field label</title></head>
<body>
<!-- test {"testId":"custom-kind-strong","detectSteps":false} -->
<h1>Check the field label</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>The field is labeled <strong>Type here:</strong>.</p>
<!-- step {"find":"Type here:"} -->
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Check the field label
=====================

.. test {"testId":"custom-kind-strong","detectSteps":false}

Open the type echo page.

.. step {"goTo":"http://localhost:8092/type-echo.html"}

The field is labeled **Type here:**.

.. step {"find":"Type here:"}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-kind-strong">
  <title>Check the field label</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-kind-strong","detectSteps":false}'/>
    <p>Open the type echo page.</p>
    <data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/>
    <p>The field is labeled <b>Type here:</b>.</p>
    <data name="doc-detective" value='step {"find":"Type here:"}'/>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-kind-strong",
      "steps": [
        {
          "goTo": "http://localhost:8092/type-echo.html"
        },
        {
          "find": "Type here:"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-kind-strong
    steps:
      - goTo: http://localhost:8092/type-echo.html
      - find: "Type here:"
```

### `emphasis`

**Varies:** `markup.emphasis` · **Value:** `{}` · **Effect:** every italic phrase becomes a `find`.

```json
{
  "name": "findItalic",
  "emphasis": {},
  "actions": [
    "find"
  ]
}
```

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Check the page heading

Open the type echo page.

The heading reads _Type Echo Test Page_.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Check the page heading

Open the type echo page.

The heading reads _Type Echo Test Page_.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Check the page heading

Open the type echo page.

The heading reads _Type Echo Test Page_.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the page heading</title></head>
<body>
<h1>Check the page heading</h1>
<p>Open the type echo page.</p>
<p>The heading reads <em>Type Echo Test Page</em>.</p>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Check the page heading
======================

Open the type echo page.

The heading reads *Type Echo Test Page*.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-kind-emphasis">
  <title>Check the page heading</title>
  <body>
    <p>Open the type echo page.</p>
    <p>The heading reads <i>Type Echo Test Page</i>.</p>
  </body>
</topic>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"custom-kind-emphasis","detectSteps":true} -->

# Check the page heading

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

The heading reads _Type Echo Test Page_.

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"custom-kind-emphasis","detectSteps":true} */}

# Check the page heading

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

The heading reads _Type Echo Test Page_.

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Check the page heading

// (test {"testId":"custom-kind-emphasis","detectSteps":true})

Open the type echo page.

// (step {"goTo":"http://localhost:8092/type-echo.html"})

The heading reads _Type Echo Test Page_.

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the page heading</title></head>
<body>
<!-- test {"testId":"custom-kind-emphasis","detectSteps":true} -->
<h1>Check the page heading</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>The heading reads <em>Type Echo Test Page</em>.</p>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Check the page heading
======================

.. test {"testId":"custom-kind-emphasis","detectSteps":true}

Open the type echo page.

.. step {"goTo":"http://localhost:8092/type-echo.html"}

The heading reads *Type Echo Test Page*.

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-kind-emphasis">
  <title>Check the page heading</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-kind-emphasis","detectSteps":true}'/>
    <p>Open the type echo page.</p>
    <data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/>
    <p>The heading reads <i>Type Echo Test Page</i>.</p>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"custom-kind-emphasis","detectSteps":false} -->

# Check the page heading

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

The heading reads _Type Echo Test Page_.

<!-- step {"find":"Type Echo Test Page"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"custom-kind-emphasis","detectSteps":false} */}

# Check the page heading

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

The heading reads _Type Echo Test Page_.

{/* step {"find":"Type Echo Test Page"} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Check the page heading

// (test {"testId":"custom-kind-emphasis","detectSteps":false})

Open the type echo page.

// (step {"goTo":"http://localhost:8092/type-echo.html"})

The heading reads _Type Echo Test Page_.

// (step {"find":"Type Echo Test Page"})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the page heading</title></head>
<body>
<!-- test {"testId":"custom-kind-emphasis","detectSteps":false} -->
<h1>Check the page heading</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>The heading reads <em>Type Echo Test Page</em>.</p>
<!-- step {"find":"Type Echo Test Page"} -->
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Check the page heading
======================

.. test {"testId":"custom-kind-emphasis","detectSteps":false}

Open the type echo page.

.. step {"goTo":"http://localhost:8092/type-echo.html"}

The heading reads *Type Echo Test Page*.

.. step {"find":"Type Echo Test Page"}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-kind-emphasis">
  <title>Check the page heading</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-kind-emphasis","detectSteps":false}'/>
    <p>Open the type echo page.</p>
    <data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/>
    <p>The heading reads <i>Type Echo Test Page</i>.</p>
    <data name="doc-detective" value='step {"find":"Type Echo Test Page"}'/>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-kind-emphasis",
      "steps": [
        {
          "goTo": "http://localhost:8092/type-echo.html"
        },
        {
          "find": "Type Echo Test Page"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-kind-emphasis
    steps:
      - goTo: http://localhost:8092/type-echo.html
      - find: Type Echo Test Page
```

### `text`

**Varies:** `markup.text` · **Value:** `{}` · **Effect:** each run of prose is a candidate, and `regex` finds the heading name inside it.

```json
{
  "name": "findHeading",
  "text": {},
  "regex": "\\bheading reads ([^.]+)\\.",
  "actions": [
    "find"
  ]
}
```

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Check the page heading

Open the type echo page.

The heading reads Type Echo Test Page.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Check the page heading

Open the type echo page.

The heading reads Type Echo Test Page.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Check the page heading

Open the type echo page.

The heading reads Type Echo Test Page.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the page heading</title></head>
<body>
<h1>Check the page heading</h1>
<p>Open the type echo page.</p>
<p>The heading reads Type Echo Test Page.</p>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Check the page heading
======================

Open the type echo page.

The heading reads Type Echo Test Page.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-kind-text">
  <title>Check the page heading</title>
  <body>
    <p>Open the type echo page.</p>
    <p>The heading reads Type Echo Test Page.</p>
  </body>
</topic>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"custom-kind-text","detectSteps":true} -->

# Check the page heading

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

The heading reads Type Echo Test Page.

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"custom-kind-text","detectSteps":true} */}

# Check the page heading

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

The heading reads Type Echo Test Page.

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Check the page heading

// (test {"testId":"custom-kind-text","detectSteps":true})

Open the type echo page.

// (step {"goTo":"http://localhost:8092/type-echo.html"})

The heading reads Type Echo Test Page.

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the page heading</title></head>
<body>
<!-- test {"testId":"custom-kind-text","detectSteps":true} -->
<h1>Check the page heading</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>The heading reads Type Echo Test Page.</p>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Check the page heading
======================

.. test {"testId":"custom-kind-text","detectSteps":true}

Open the type echo page.

.. step {"goTo":"http://localhost:8092/type-echo.html"}

The heading reads Type Echo Test Page.

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-kind-text">
  <title>Check the page heading</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-kind-text","detectSteps":true}'/>
    <p>Open the type echo page.</p>
    <data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/>
    <p>The heading reads Type Echo Test Page.</p>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"custom-kind-text","detectSteps":false} -->

# Check the page heading

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

The heading reads Type Echo Test Page.

<!-- step {"find":"Type Echo Test Page"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"custom-kind-text","detectSteps":false} */}

# Check the page heading

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

The heading reads Type Echo Test Page.

{/* step {"find":"Type Echo Test Page"} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Check the page heading

// (test {"testId":"custom-kind-text","detectSteps":false})

Open the type echo page.

// (step {"goTo":"http://localhost:8092/type-echo.html"})

The heading reads Type Echo Test Page.

// (step {"find":"Type Echo Test Page"})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the page heading</title></head>
<body>
<!-- test {"testId":"custom-kind-text","detectSteps":false} -->
<h1>Check the page heading</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>The heading reads Type Echo Test Page.</p>
<!-- step {"find":"Type Echo Test Page"} -->
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Check the page heading
======================

.. test {"testId":"custom-kind-text","detectSteps":false}

Open the type echo page.

.. step {"goTo":"http://localhost:8092/type-echo.html"}

The heading reads Type Echo Test Page.

.. step {"find":"Type Echo Test Page"}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-kind-text">
  <title>Check the page heading</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-kind-text","detectSteps":false}'/>
    <p>Open the type echo page.</p>
    <data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/>
    <p>The heading reads Type Echo Test Page.</p>
    <data name="doc-detective" value='step {"find":"Type Echo Test Page"}'/>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-kind-text",
      "steps": [
        {
          "goTo": "http://localhost:8092/type-echo.html"
        },
        {
          "find": "Type Echo Test Page"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-kind-text
    steps:
      - goTo: http://localhost:8092/type-echo.html
      - find: Type Echo Test Page
```

A bare `text: {}` matches every run of prose, so a text definition needs `regex`.

### `element`

**Varies:** `markup.element` · **Value:** `"samp"` · **Effect:** each `<samp>` element becomes a `find`. A string names one tag.

```json
{
  "name": "findSample",
  "element": "samp",
  "actions": [
    "find"
  ]
}
```

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Check the field label

Open the type echo page.

The page shows <samp>Type here:</samp> next to the field.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Check the field label

Open the type echo page.

The page shows <samp>Type here:</samp> next to the field.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the field label</title></head>
<body>
<h1>Check the field label</h1>
<p>Open the type echo page.</p>
<p>The page shows <samp>Type here:</samp> next to the field.</p>
</body>
</html>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"custom-kind-element","detectSteps":true} -->

# Check the field label

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

The page shows <samp>Type here:</samp> next to the field.

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"custom-kind-element","detectSteps":true} */}

# Check the field label

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

The page shows <samp>Type here:</samp> next to the field.

{/* test end */}
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the field label</title></head>
<body>
<!-- test {"testId":"custom-kind-element","detectSteps":true} -->
<h1>Check the field label</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>The page shows <samp>Type here:</samp> next to the field.</p>
<!-- test end -->
</body>
</html>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"custom-kind-element","detectSteps":false} -->

# Check the field label

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

The page shows <samp>Type here:</samp> next to the field.

<!-- step {"find":"Type here:"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"custom-kind-element","detectSteps":false} */}

# Check the field label

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

The page shows <samp>Type here:</samp> next to the field.

{/* step {"find":"Type here:"} */}

{/* test end */}
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the field label</title></head>
<body>
<!-- test {"testId":"custom-kind-element","detectSteps":false} -->
<h1>Check the field label</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>The page shows <samp>Type here:</samp> next to the field.</p>
<!-- step {"find":"Type here:"} -->
<!-- test end -->
</body>
</html>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-kind-element",
      "steps": [
        {
          "goTo": "http://localhost:8092/type-echo.html"
        },
        {
          "find": "Type here:"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-kind-element
    steps:
      - goTo: http://localhost:8092/type-echo.html
      - find: "Type here:"
```

Only Markdown, MDX, and HTML produce `<samp>`. AsciiDoc and reStructuredText produce no `element` nodes. DITA's equivalent tag is in the `tag` example below.

## Selector option permutations

Each example adds one option to a selector, and leaves out the content the option skips or keeps. The file types don't use `extends`, as in the kind examples.

### `precededBy`

**Varies:** `markup.strong.precededBy` · **Value:** `\\b[Cc]lick\\s+$` · **Effect:** only a bold phrase right after `Click` becomes a `click`.

```json
{
  "name": "clickBold",
  "strong": {
    "precededBy": "\\b[Cc]lick\\s+$"
  },
  "actions": [
    "click"
  ]
}
```

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Type into the field

Open the type echo page.

Click **Type here:**.

Type Hello, Doc Detective.

The page shows **Hello, Doc Detective** below the field.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Type into the field

Open the type echo page.

Click **Type here:**.

Type Hello, Doc Detective.

The page shows **Hello, Doc Detective** below the field.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Type into the field

Open the type echo page.

Click *Type here:*.

Type Hello, Doc Detective.

The page shows *Hello, Doc Detective* below the field.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Type into the field</title></head>
<body>
<h1>Type into the field</h1>
<p>Open the type echo page.</p>
<p>Click <strong>Type here:</strong>.</p>
<p>Type Hello, Doc Detective.</p>
<p>The page shows <strong>Hello, Doc Detective</strong> below the field.</p>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Type into the field
===================

Open the type echo page.

Click **Type here:**.

Type Hello, Doc Detective.

The page shows **Hello, Doc Detective** below the field.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-option-precededby">
  <title>Type into the field</title>
  <body>
    <p>Open the type echo page.</p>
    <p>Click <b>Type here:</b>.</p>
    <p>Type Hello, Doc Detective.</p>
    <p>The page shows <b>Hello, Doc Detective</b> below the field.</p>
  </body>
</topic>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"custom-option-precededby","detectSteps":true} -->

# Type into the field

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

Click **Type here:**.

Type Hello, Doc Detective.

<!-- step {"type":"Hello, Doc Detective"} -->

The page shows **Hello, Doc Detective** below the field.

<!-- step {"find":"Hello, Doc Detective"} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"custom-option-precededby","detectSteps":true} */}

# Type into the field

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

Click **Type here:**.

Type Hello, Doc Detective.

{/* step {"type":"Hello, Doc Detective"} */}

The page shows **Hello, Doc Detective** below the field.

{/* step {"find":"Hello, Doc Detective"} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Type into the field

// (test {"testId":"custom-option-precededby","detectSteps":true})

Open the type echo page.

// (step {"goTo":"http://localhost:8092/type-echo.html"})

Click *Type here:*.

Type Hello, Doc Detective.

// (step {"type":"Hello, Doc Detective"})

The page shows *Hello, Doc Detective* below the field.

// (step {"find":"Hello, Doc Detective"})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Type into the field</title></head>
<body>
<!-- test {"testId":"custom-option-precededby","detectSteps":true} -->
<h1>Type into the field</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>Click <strong>Type here:</strong>.</p>
<p>Type Hello, Doc Detective.</p>
<!-- step {"type":"Hello, Doc Detective"} -->
<p>The page shows <strong>Hello, Doc Detective</strong> below the field.</p>
<!-- step {"find":"Hello, Doc Detective"} -->
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Type into the field
===================

.. test {"testId":"custom-option-precededby","detectSteps":true}

Open the type echo page.

.. step {"goTo":"http://localhost:8092/type-echo.html"}

Click **Type here:**.

Type Hello, Doc Detective.

.. step {"type":"Hello, Doc Detective"}

The page shows **Hello, Doc Detective** below the field.

.. step {"find":"Hello, Doc Detective"}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-option-precededby">
  <title>Type into the field</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-option-precededby","detectSteps":true}'/>
    <p>Open the type echo page.</p>
    <data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/>
    <p>Click <b>Type here:</b>.</p>
    <p>Type Hello, Doc Detective.</p>
    <data name="doc-detective" value='step {"type":"Hello, Doc Detective"}'/>
    <p>The page shows <b>Hello, Doc Detective</b> below the field.</p>
    <data name="doc-detective" value='step {"find":"Hello, Doc Detective"}'/>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"custom-option-precededby","detectSteps":false} -->

# Type into the field

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

Click **Type here:**.

<!-- step {"click":"Type here:"} -->

Type Hello, Doc Detective.

<!-- step {"type":"Hello, Doc Detective"} -->

The page shows **Hello, Doc Detective** below the field.

<!-- step {"find":"Hello, Doc Detective"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"custom-option-precededby","detectSteps":false} */}

# Type into the field

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

Click **Type here:**.

{/* step {"click":"Type here:"} */}

Type Hello, Doc Detective.

{/* step {"type":"Hello, Doc Detective"} */}

The page shows **Hello, Doc Detective** below the field.

{/* step {"find":"Hello, Doc Detective"} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Type into the field

// (test {"testId":"custom-option-precededby","detectSteps":false})

Open the type echo page.

// (step {"goTo":"http://localhost:8092/type-echo.html"})

Click *Type here:*.

// (step {"click":"Type here:"})

Type Hello, Doc Detective.

// (step {"type":"Hello, Doc Detective"})

The page shows *Hello, Doc Detective* below the field.

// (step {"find":"Hello, Doc Detective"})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Type into the field</title></head>
<body>
<!-- test {"testId":"custom-option-precededby","detectSteps":false} -->
<h1>Type into the field</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>Click <strong>Type here:</strong>.</p>
<!-- step {"click":"Type here:"} -->
<p>Type Hello, Doc Detective.</p>
<!-- step {"type":"Hello, Doc Detective"} -->
<p>The page shows <strong>Hello, Doc Detective</strong> below the field.</p>
<!-- step {"find":"Hello, Doc Detective"} -->
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Type into the field
===================

.. test {"testId":"custom-option-precededby","detectSteps":false}

Open the type echo page.

.. step {"goTo":"http://localhost:8092/type-echo.html"}

Click **Type here:**.

.. step {"click":"Type here:"}

Type Hello, Doc Detective.

.. step {"type":"Hello, Doc Detective"}

The page shows **Hello, Doc Detective** below the field.

.. step {"find":"Hello, Doc Detective"}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-option-precededby">
  <title>Type into the field</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-option-precededby","detectSteps":false}'/>
    <p>Open the type echo page.</p>
    <data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/>
    <p>Click <b>Type here:</b>.</p>
    <data name="doc-detective" value='step {"click":"Type here:"}'/>
    <p>Type Hello, Doc Detective.</p>
    <data name="doc-detective" value='step {"type":"Hello, Doc Detective"}'/>
    <p>The page shows <b>Hello, Doc Detective</b> below the field.</p>
    <data name="doc-detective" value='step {"find":"Hello, Doc Detective"}'/>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-option-precededby",
      "steps": [
        {
          "goTo": "http://localhost:8092/type-echo.html"
        },
        {
          "click": "Type here:"
        },
        {
          "type": "Hello, Doc Detective"
        },
        {
          "find": "Hello, Doc Detective"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-option-precededby
    steps:
      - goTo: http://localhost:8092/type-echo.html
      - click: "Type here:"
      - type: Hello, Doc Detective
      - find: Hello, Doc Detective
```

The second bold phrase isn't after `Click`, so detection skips it. A `step` statement checks it instead.

### `attributes`

**Varies:** `markup.image.attributes` · **Value:** `{ "class": "(^|\\s)check(\\s|$)" }` · **Effect:** only the image with the `check` class gets a `checkLink`.

```json
{
  "name": "checkMarkedImage",
  "image": {
    "attributes": {
      "class": "(^|\\s)check(\\s|$)"
    }
  },
  "captures": [
    "src"
  ],
  "actions": [
    "checkLink"
  ]
}
```

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Check the icons a page uses

The page uses these icons:

![Target icon](http://localhost:8092/find-image-target.svg){.check}

![Gear icon](http://localhost:8092/find-image-gear.svg)
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Check the icons a page uses

The page uses these icons:

<img src="http://localhost:8092/find-image-target.svg" alt="Target icon" className="check" />

![Gear icon](http://localhost:8092/find-image-gear.svg)
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Check the icons a page uses

The page uses these icons:

image::http://localhost:8092/find-image-target.svg[Target icon,role=check]

image::http://localhost:8092/find-image-gear.svg[Gear icon]
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the icons a page uses</title></head>
<body>
<h1>Check the icons a page uses</h1>
<p>The page uses these icons:</p>
<p><img src="http://localhost:8092/find-image-target.svg" alt="Target icon" class="check"></p>
<p><img src="http://localhost:8092/find-image-gear.svg" alt="Gear icon"></p>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Check the icons a page uses
===========================

The page uses these icons:

.. image:: http://localhost:8092/find-image-target.svg
   :alt: Target icon
   :class: check

.. image:: http://localhost:8092/find-image-gear.svg
   :alt: Gear icon
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-option-attributes">
  <title>Check the icons a page uses</title>
  <body>
    <p>The page uses these icons:</p>
    <image href="http://localhost:8092/find-image-target.svg" outputclass="check"><alt>Target icon</alt></image>
    <image href="http://localhost:8092/find-image-gear.svg"><alt>Gear icon</alt></image>
  </body>
</topic>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"custom-option-attributes","detectSteps":true} -->

# Check the icons a page uses

The page uses these icons:

![Target icon](http://localhost:8092/find-image-target.svg){.check}

![Gear icon](http://localhost:8092/find-image-gear.svg)

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"custom-option-attributes","detectSteps":true} */}

# Check the icons a page uses

The page uses these icons:

<img src="http://localhost:8092/find-image-target.svg" alt="Target icon" className="check" />

![Gear icon](http://localhost:8092/find-image-gear.svg)

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Check the icons a page uses

// (test {"testId":"custom-option-attributes","detectSteps":true})

The page uses these icons:

image::http://localhost:8092/find-image-target.svg[Target icon,role=check]

image::http://localhost:8092/find-image-gear.svg[Gear icon]

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the icons a page uses</title></head>
<body>
<!-- test {"testId":"custom-option-attributes","detectSteps":true} -->
<h1>Check the icons a page uses</h1>
<p>The page uses these icons:</p>
<p><img src="http://localhost:8092/find-image-target.svg" alt="Target icon" class="check"></p>
<p><img src="http://localhost:8092/find-image-gear.svg" alt="Gear icon"></p>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Check the icons a page uses
===========================

.. test {"testId":"custom-option-attributes","detectSteps":true}

The page uses these icons:

.. image:: http://localhost:8092/find-image-target.svg
   :alt: Target icon
   :class: check

.. image:: http://localhost:8092/find-image-gear.svg
   :alt: Gear icon

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-option-attributes">
  <title>Check the icons a page uses</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-option-attributes","detectSteps":true}'/>
    <p>The page uses these icons:</p>
    <image href="http://localhost:8092/find-image-target.svg" outputclass="check"><alt>Target icon</alt></image>
    <image href="http://localhost:8092/find-image-gear.svg"><alt>Gear icon</alt></image>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"custom-option-attributes","detectSteps":false} -->

# Check the icons a page uses

The page uses these icons:

![Target icon](http://localhost:8092/find-image-target.svg){.check}

<!-- step {"checkLink":"http://localhost:8092/find-image-target.svg"} -->

![Gear icon](http://localhost:8092/find-image-gear.svg)

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"custom-option-attributes","detectSteps":false} */}

# Check the icons a page uses

The page uses these icons:

<img src="http://localhost:8092/find-image-target.svg" alt="Target icon" className="check" />

{/* step {"checkLink":"http://localhost:8092/find-image-target.svg"} */}

![Gear icon](http://localhost:8092/find-image-gear.svg)

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Check the icons a page uses

// (test {"testId":"custom-option-attributes","detectSteps":false})

The page uses these icons:

image::http://localhost:8092/find-image-target.svg[Target icon,role=check]

// (step {"checkLink":"http://localhost:8092/find-image-target.svg"})

image::http://localhost:8092/find-image-gear.svg[Gear icon]

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the icons a page uses</title></head>
<body>
<!-- test {"testId":"custom-option-attributes","detectSteps":false} -->
<h1>Check the icons a page uses</h1>
<p>The page uses these icons:</p>
<p><img src="http://localhost:8092/find-image-target.svg" alt="Target icon" class="check"></p>
<!-- step {"checkLink":"http://localhost:8092/find-image-target.svg"} -->
<p><img src="http://localhost:8092/find-image-gear.svg" alt="Gear icon"></p>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Check the icons a page uses
===========================

.. test {"testId":"custom-option-attributes","detectSteps":false}

The page uses these icons:

.. image:: http://localhost:8092/find-image-target.svg
   :alt: Target icon
   :class: check

.. step {"checkLink":"http://localhost:8092/find-image-target.svg"}

.. image:: http://localhost:8092/find-image-gear.svg
   :alt: Gear icon

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-option-attributes">
  <title>Check the icons a page uses</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-option-attributes","detectSteps":false}'/>
    <p>The page uses these icons:</p>
    <image href="http://localhost:8092/find-image-target.svg" outputclass="check"><alt>Target icon</alt></image>
    <data name="doc-detective" value='step {"checkLink":"http://localhost:8092/find-image-target.svg"}'/>
    <image href="http://localhost:8092/find-image-gear.svg"><alt>Gear icon</alt></image>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-option-attributes",
      "steps": [
        {
          "checkLink": "http://localhost:8092/find-image-target.svg"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-option-attributes
    steps:
      - checkLink: http://localhost:8092/find-image-target.svg
```

Each format sets `class` its own way: `{.check}` in Markdown, `className` in MDX, `role=` in AsciiDoc, `:class:` in reStructuredText, and `outputclass` in DITA.

### `excludes`

**Varies:** `markup.strong.excludes` · **Value:** `^(?:Note|Tip):?$` · **Effect:** the `Note:` label isn't turned into a `find`.

```json
{
  "name": "findBold",
  "strong": {
    "excludes": "^(?:Note|Tip):?$"
  },
  "actions": [
    "find"
  ]
}
```

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Check the field label

Open the type echo page.

**Note:** The field echoes each keystroke.

The field is labeled **Type here:**.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Check the field label

Open the type echo page.

**Note:** The field echoes each keystroke.

The field is labeled **Type here:**.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Check the field label

Open the type echo page.

*Note:* The field echoes each keystroke.

The field is labeled *Type here:*.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the field label</title></head>
<body>
<h1>Check the field label</h1>
<p>Open the type echo page.</p>
<p><strong>Note:</strong> The field echoes each keystroke.</p>
<p>The field is labeled <strong>Type here:</strong>.</p>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Check the field label
=====================

Open the type echo page.

**Note:** The field echoes each keystroke.

The field is labeled **Type here:**.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-option-excludes">
  <title>Check the field label</title>
  <body>
    <p>Open the type echo page.</p>
    <p><b>Note:</b> The field echoes each keystroke.</p>
    <p>The field is labeled <b>Type here:</b>.</p>
  </body>
</topic>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"custom-option-excludes","detectSteps":true} -->

# Check the field label

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

**Note:** The field echoes each keystroke.

The field is labeled **Type here:**.

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"custom-option-excludes","detectSteps":true} */}

# Check the field label

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

**Note:** The field echoes each keystroke.

The field is labeled **Type here:**.

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Check the field label

// (test {"testId":"custom-option-excludes","detectSteps":true})

Open the type echo page.

// (step {"goTo":"http://localhost:8092/type-echo.html"})

*Note:* The field echoes each keystroke.

The field is labeled *Type here:*.

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the field label</title></head>
<body>
<!-- test {"testId":"custom-option-excludes","detectSteps":true} -->
<h1>Check the field label</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p><strong>Note:</strong> The field echoes each keystroke.</p>
<p>The field is labeled <strong>Type here:</strong>.</p>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Check the field label
=====================

.. test {"testId":"custom-option-excludes","detectSteps":true}

Open the type echo page.

.. step {"goTo":"http://localhost:8092/type-echo.html"}

**Note:** The field echoes each keystroke.

The field is labeled **Type here:**.

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-option-excludes">
  <title>Check the field label</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-option-excludes","detectSteps":true}'/>
    <p>Open the type echo page.</p>
    <data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/>
    <p><b>Note:</b> The field echoes each keystroke.</p>
    <p>The field is labeled <b>Type here:</b>.</p>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"custom-option-excludes","detectSteps":false} -->

# Check the field label

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

**Note:** The field echoes each keystroke.

The field is labeled **Type here:**.

<!-- step {"find":"Type here:"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"custom-option-excludes","detectSteps":false} */}

# Check the field label

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

**Note:** The field echoes each keystroke.

The field is labeled **Type here:**.

{/* step {"find":"Type here:"} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Check the field label

// (test {"testId":"custom-option-excludes","detectSteps":false})

Open the type echo page.

// (step {"goTo":"http://localhost:8092/type-echo.html"})

*Note:* The field echoes each keystroke.

The field is labeled *Type here:*.

// (step {"find":"Type here:"})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the field label</title></head>
<body>
<!-- test {"testId":"custom-option-excludes","detectSteps":false} -->
<h1>Check the field label</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p><strong>Note:</strong> The field echoes each keystroke.</p>
<p>The field is labeled <strong>Type here:</strong>.</p>
<!-- step {"find":"Type here:"} -->
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Check the field label
=====================

.. test {"testId":"custom-option-excludes","detectSteps":false}

Open the type echo page.

.. step {"goTo":"http://localhost:8092/type-echo.html"}

**Note:** The field echoes each keystroke.

The field is labeled **Type here:**.

.. step {"find":"Type here:"}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-option-excludes">
  <title>Check the field label</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-option-excludes","detectSteps":false}'/>
    <p>Open the type echo page.</p>
    <data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/>
    <p><b>Note:</b> The field echoes each keystroke.</p>
    <p>The field is labeled <b>Type here:</b>.</p>
    <data name="doc-detective" value='step {"find":"Type here:"}'/>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-option-excludes",
      "steps": [
        {
          "goTo": "http://localhost:8092/type-echo.html"
        },
        {
          "find": "Type here:"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-option-excludes
    steps:
      - goTo: http://localhost:8092/type-echo.html
      - find: "Type here:"
```

### `captures`

**Varies:** `markup.captures` · **Value:** `["url"]` · **Effect:** `$1` is the link's URL instead of its text, so the step checks the link.

```json
{
  "name": "checkLinkUrl",
  "link": {},
  "captures": [
    "url"
  ],
  "actions": [
    "checkLink"
  ]
}
```

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Check a link

Open [the type echo page](http://localhost:8092/type-echo.html).
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Check a link

Open [the type echo page](http://localhost:8092/type-echo.html).
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Check a link

Open http://localhost:8092/type-echo.html[the type echo page].
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check a link</title></head>
<body>
<h1>Check a link</h1>
<p>Open <a href="http://localhost:8092/type-echo.html">the type echo page</a>.</p>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Check a link
============

Open `the type echo page <http://localhost:8092/type-echo.html>`__.
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"custom-option-captures","detectSteps":true} -->

# Check a link

Open [the type echo page](http://localhost:8092/type-echo.html).

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"custom-option-captures","detectSteps":true} */}

# Check a link

Open [the type echo page](http://localhost:8092/type-echo.html).

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Check a link

// (test {"testId":"custom-option-captures","detectSteps":true})

Open http://localhost:8092/type-echo.html[the type echo page].

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check a link</title></head>
<body>
<!-- test {"testId":"custom-option-captures","detectSteps":true} -->
<h1>Check a link</h1>
<p>Open <a href="http://localhost:8092/type-echo.html">the type echo page</a>.</p>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Check a link
============

.. test {"testId":"custom-option-captures","detectSteps":true}

Open `the type echo page <http://localhost:8092/type-echo.html>`__.

.. test end
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"custom-option-captures","detectSteps":false} -->

# Check a link

Open [the type echo page](http://localhost:8092/type-echo.html).

<!-- step {"checkLink":"http://localhost:8092/type-echo.html"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"custom-option-captures","detectSteps":false} */}

# Check a link

Open [the type echo page](http://localhost:8092/type-echo.html).

{/* step {"checkLink":"http://localhost:8092/type-echo.html"} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Check a link

// (test {"testId":"custom-option-captures","detectSteps":false})

Open http://localhost:8092/type-echo.html[the type echo page].

// (step {"checkLink":"http://localhost:8092/type-echo.html"})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check a link</title></head>
<body>
<!-- test {"testId":"custom-option-captures","detectSteps":false} -->
<h1>Check a link</h1>
<p>Open <a href="http://localhost:8092/type-echo.html">the type echo page</a>.</p>
<!-- step {"checkLink":"http://localhost:8092/type-echo.html"} -->
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Check a link
============

.. test {"testId":"custom-option-captures","detectSteps":false}

Open `the type echo page <http://localhost:8092/type-echo.html>`__.

.. step {"checkLink":"http://localhost:8092/type-echo.html"}

.. test end
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-option-captures",
      "steps": [
        {
          "checkLink": "http://localhost:8092/type-echo.html"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-option-captures
    steps:
      - checkLink: http://localhost:8092/type-echo.html
```

Compare the `link` kind example, where `$1` is the link text. DITA has no `link` nodes, so this example leaves it out.

### `batchMatches`

**Varies:** `markup.batchMatches` · **Value:** `true` · **Effect:** the two code blocks join into one `runCode` step, so the second block can use the first block's variable.

```json
{
  "name": "runScript",
  "codeBlock": {
    "language": [
      "javascript"
    ]
  },
  "batchMatches": true,
  "actions": [
    {
      "runCode": {
        "language": "javascript",
        "code": "$1"
      }
    }
  ]
}
```

#### Prose

#### Markdown

**`prose.md`**

````markdown title="prose.md"
# Print a greeting with Node.js

Define the name to greet:

```javascript
const name = "Doc Detective";
```

Print the greeting:

```javascript
console.log(`Hello, ${name}!`);
```
````

#### MDX

**`prose.mdx`**

````mdx title="prose.mdx"
# Print a greeting with Node.js

Define the name to greet:

```javascript
const name = "Doc Detective";
```

Print the greeting:

```javascript
console.log(`Hello, ${name}!`);
```
````

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Print a greeting with Node.js

Define the name to greet:

[source,javascript]
----
const name = "Doc Detective";
----

Print the greeting:

[source,javascript]
----
console.log(`Hello, ${name}!`);
----
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Print a greeting with Node.js</title></head>
<body>
<h1>Print a greeting with Node.js</h1>
<p>Define the name to greet:</p>
<pre><code class="language-javascript">const name = "Doc Detective";</code></pre>
<p>Print the greeting:</p>
<pre><code class="language-javascript">console.log(`Hello, ${name}!`);</code></pre>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Print a greeting with Node.js
=============================

Define the name to greet:

.. code-block:: javascript

   const name = "Doc Detective";

Print the greeting:

.. code-block:: javascript

   console.log(`Hello, ${name}!`);
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-option-batchmatches">
  <title>Print a greeting with Node.js</title>
  <body>
    <p>Define the name to greet:</p>
    <codeblock outputclass="language-javascript">const name = "Doc Detective";</codeblock>
    <p>Print the greeting:</p>
    <codeblock outputclass="language-javascript">console.log(`Hello, ${name}!`);</codeblock>
  </body>
</topic>
```

#### Detected

#### Markdown

**`detected.md`**

````markdown title="detected.md"
<!-- test {"testId":"custom-option-batchmatches","detectSteps":true} -->

# Print a greeting with Node.js

Define the name to greet:

```javascript
const name = "Doc Detective";
```

Print the greeting:

```javascript
console.log(`Hello, ${name}!`);
```

<!-- test end -->
````

#### MDX

**`detected.mdx`**

````mdx title="detected.mdx"
{/* test {"testId":"custom-option-batchmatches","detectSteps":true} */}

# Print a greeting with Node.js

Define the name to greet:

```javascript
const name = "Doc Detective";
```

Print the greeting:

```javascript
console.log(`Hello, ${name}!`);
```

{/* test end */}
````

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Print a greeting with Node.js

// (test {"testId":"custom-option-batchmatches","detectSteps":true})

Define the name to greet:

[source,javascript]
----
const name = "Doc Detective";
----

Print the greeting:

[source,javascript]
----
console.log(`Hello, ${name}!`);
----

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Print a greeting with Node.js</title></head>
<body>
<!-- test {"testId":"custom-option-batchmatches","detectSteps":true} -->
<h1>Print a greeting with Node.js</h1>
<p>Define the name to greet:</p>
<pre><code class="language-javascript">const name = "Doc Detective";</code></pre>
<p>Print the greeting:</p>
<pre><code class="language-javascript">console.log(`Hello, ${name}!`);</code></pre>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Print a greeting with Node.js
=============================

.. test {"testId":"custom-option-batchmatches","detectSteps":true}

Define the name to greet:

.. code-block:: javascript

   const name = "Doc Detective";

Print the greeting:

.. code-block:: javascript

   console.log(`Hello, ${name}!`);

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-option-batchmatches">
  <title>Print a greeting with Node.js</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-option-batchmatches","detectSteps":true}'/>
    <p>Define the name to greet:</p>
    <codeblock outputclass="language-javascript">const name = "Doc Detective";</codeblock>
    <p>Print the greeting:</p>
    <codeblock outputclass="language-javascript">console.log(`Hello, ${name}!`);</codeblock>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Inline

#### Markdown

**`inline.md`**

````markdown title="inline.md"
<!-- test {"testId":"custom-option-batchmatches","detectSteps":false} -->

# Print a greeting with Node.js

Define the name to greet:

```javascript
const name = "Doc Detective";
```

Print the greeting:

```javascript
console.log(`Hello, ${name}!`);
```

<!-- step {"runCode":{"language":"javascript","code":"const name = \"Doc Detective\";\nconsole.log(`Hello, ${name}!`);"}} -->

<!-- test end -->
````

#### MDX

**`inline.mdx`**

````mdx title="inline.mdx"
{/* test {"testId":"custom-option-batchmatches","detectSteps":false} */}

# Print a greeting with Node.js

Define the name to greet:

```javascript
const name = "Doc Detective";
```

Print the greeting:

```javascript
console.log(`Hello, ${name}!`);
```

{/* step {"runCode":{"language":"javascript","code":"const name = \"Doc Detective\";\nconsole.log(`Hello, ${name}!`);"}} */}

{/* test end */}
````

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Print a greeting with Node.js

// (test {"testId":"custom-option-batchmatches","detectSteps":false})

Define the name to greet:

[source,javascript]
----
const name = "Doc Detective";
----

Print the greeting:

[source,javascript]
----
console.log(`Hello, ${name}!`);
----

// (step {"runCode":{"language":"javascript","code":"const name = \"Doc Detective\";\nconsole.log(`Hello, ${name}!`);"}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Print a greeting with Node.js</title></head>
<body>
<!-- test {"testId":"custom-option-batchmatches","detectSteps":false} -->
<h1>Print a greeting with Node.js</h1>
<p>Define the name to greet:</p>
<pre><code class="language-javascript">const name = "Doc Detective";</code></pre>
<p>Print the greeting:</p>
<pre><code class="language-javascript">console.log(`Hello, ${name}!`);</code></pre>
<!-- step {"runCode":{"language":"javascript","code":"const name = \"Doc Detective\";\nconsole.log(`Hello, ${name}!`);"}} -->
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Print a greeting with Node.js
=============================

.. test {"testId":"custom-option-batchmatches","detectSteps":false}

Define the name to greet:

.. code-block:: javascript

   const name = "Doc Detective";

Print the greeting:

.. code-block:: javascript

   console.log(`Hello, ${name}!`);

.. step {"runCode":{"language":"javascript","code":"const name = \"Doc Detective\";\nconsole.log(`Hello, ${name}!`);"}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-option-batchmatches">
  <title>Print a greeting with Node.js</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-option-batchmatches","detectSteps":false}'/>
    <p>Define the name to greet:</p>
    <codeblock outputclass="language-javascript">const name = "Doc Detective";</codeblock>
    <p>Print the greeting:</p>
    <codeblock outputclass="language-javascript">console.log(`Hello, ${name}!`);</codeblock>
    <data name="doc-detective" value='step {"runCode":{"language":"javascript","code":"const name = \"Doc Detective\";\nconsole.log(`Hello, ${name}!`);"}}'/>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-option-batchmatches",
      "steps": [
        {
          "runCode": {
            "language": "javascript",
            "code": "const name = \"Doc Detective\";\nconsole.log(`Hello, ${name}!`);"
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-option-batchmatches
    steps:
      - runCode:
          language: javascript
          code: |-
            const name = "Doc Detective";
            console.log(`Hello, ${name}!`);
```

### `regex` without a selector

**Varies:** `markup.regex` · **Value:** `\\bheading reads ([^.<]+)\\.` · **Effect:** the pattern runs on the file's raw text, including markup, and its first group becomes `$1`.

```json
{
  "name": "findHeading",
  "regex": "\\bheading reads ([^.<]+)\\.",
  "actions": [
    "find"
  ]
}
```

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Check the page heading

Open the type echo page.

The heading reads Type Echo Test Page.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Check the page heading

Open the type echo page.

The heading reads Type Echo Test Page.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Check the page heading

Open the type echo page.

The heading reads Type Echo Test Page.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the page heading</title></head>
<body>
<h1>Check the page heading</h1>
<p>Open the type echo page.</p>
<p>The heading reads Type Echo Test Page.</p>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Check the page heading
======================

Open the type echo page.

The heading reads Type Echo Test Page.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-option-regex">
  <title>Check the page heading</title>
  <body>
    <p>Open the type echo page.</p>
    <p>The heading reads Type Echo Test Page.</p>
  </body>
</topic>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"custom-option-regex","detectSteps":true} -->

# Check the page heading

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

The heading reads Type Echo Test Page.

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"custom-option-regex","detectSteps":true} */}

# Check the page heading

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

The heading reads Type Echo Test Page.

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Check the page heading

// (test {"testId":"custom-option-regex","detectSteps":true})

Open the type echo page.

// (step {"goTo":"http://localhost:8092/type-echo.html"})

The heading reads Type Echo Test Page.

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the page heading</title></head>
<body>
<!-- test {"testId":"custom-option-regex","detectSteps":true} -->
<h1>Check the page heading</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>The heading reads Type Echo Test Page.</p>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Check the page heading
======================

.. test {"testId":"custom-option-regex","detectSteps":true}

Open the type echo page.

.. step {"goTo":"http://localhost:8092/type-echo.html"}

The heading reads Type Echo Test Page.

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-option-regex">
  <title>Check the page heading</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-option-regex","detectSteps":true}'/>
    <p>Open the type echo page.</p>
    <data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/>
    <p>The heading reads Type Echo Test Page.</p>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"custom-option-regex","detectSteps":false} -->

# Check the page heading

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

The heading reads Type Echo Test Page.

<!-- step {"find":"Type Echo Test Page"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"custom-option-regex","detectSteps":false} */}

# Check the page heading

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

The heading reads Type Echo Test Page.

{/* step {"find":"Type Echo Test Page"} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Check the page heading

// (test {"testId":"custom-option-regex","detectSteps":false})

Open the type echo page.

// (step {"goTo":"http://localhost:8092/type-echo.html"})

The heading reads Type Echo Test Page.

// (step {"find":"Type Echo Test Page"})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the page heading</title></head>
<body>
<!-- test {"testId":"custom-option-regex","detectSteps":false} -->
<h1>Check the page heading</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>The heading reads Type Echo Test Page.</p>
<!-- step {"find":"Type Echo Test Page"} -->
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Check the page heading
======================

.. test {"testId":"custom-option-regex","detectSteps":false}

Open the type echo page.

.. step {"goTo":"http://localhost:8092/type-echo.html"}

The heading reads Type Echo Test Page.

.. step {"find":"Type Echo Test Page"}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-option-regex">
  <title>Check the page heading</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-option-regex","detectSteps":false}'/>
    <p>Open the type echo page.</p>
    <data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/>
    <p>The heading reads Type Echo Test Page.</p>
    <data name="doc-detective" value='step {"find":"Type Echo Test Page"}'/>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-option-regex",
      "steps": [
        {
          "goTo": "http://localhost:8092/type-echo.html"
        },
        {
          "find": "Type Echo Test Page"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-option-regex
    steps:
      - goTo: http://localhost:8092/type-echo.html
      - find: Type Echo Test Page
```

Compare the `text` kind example, where the same kind of pattern runs only on prose. `[^.<]` keeps an HTML or DITA match from running into the closing tag.

### `language`

**Varies:** `markup.codeBlock.language` · **Value:** `["bash"]` · **Effect:** only the `bash` block runs. The `text` block that shows the output doesn't.

```json
{
  "name": "runBash",
  "codeBlock": {
    "language": [
      "bash"
    ]
  },
  "actions": [
    "runShell"
  ]
}
```

#### Prose

#### Markdown

**`prose.md`**

````markdown title="prose.md"
# Check the page's status code

Print the page's status code:

```bash
curl -s -o /dev/null -w "%{http_code}" http://localhost:8092/type-echo.html
```

The command prints:

```text
200
```
````

#### MDX

**`prose.mdx`**

````mdx title="prose.mdx"
# Check the page's status code

Print the page's status code:

```bash
curl -s -o /dev/null -w "%{http_code}" http://localhost:8092/type-echo.html
```

The command prints:

```text
200
```
````

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Check the page's status code

Print the page's status code:

[source,bash]
----
curl -s -o /dev/null -w "%{http_code}" http://localhost:8092/type-echo.html
----

The command prints:

[source,text]
----
200
----
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the page's status code</title></head>
<body>
<h1>Check the page's status code</h1>
<p>Print the page's status code:</p>
<pre><code class="language-bash">curl -s -o /dev/null -w "%{http_code}" http://localhost:8092/type-echo.html</code></pre>
<p>The command prints:</p>
<pre><code class="language-text">200</code></pre>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Check the page's status code
============================

Print the page's status code:

.. code-block:: bash

   curl -s -o /dev/null -w "%{http_code}" http://localhost:8092/type-echo.html

The command prints:

.. code-block:: text

   200
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-option-language">
  <title>Check the page's status code</title>
  <body>
    <p>Print the page's status code:</p>
    <codeblock outputclass="language-bash">curl -s -o /dev/null -w "%{http_code}" http://localhost:8092/type-echo.html</codeblock>
    <p>The command prints:</p>
    <codeblock outputclass="language-text">200</codeblock>
  </body>
</topic>
```

#### Detected

#### Markdown

**`detected.md`**

````markdown title="detected.md"
<!-- test {"testId":"custom-option-language","detectSteps":true} -->

# Check the page's status code

Print the page's status code:

```bash
curl -s -o /dev/null -w "%{http_code}" http://localhost:8092/type-echo.html
```

The command prints:

```text
200
```

<!-- test end -->
````

#### MDX

**`detected.mdx`**

````mdx title="detected.mdx"
{/* test {"testId":"custom-option-language","detectSteps":true} */}

# Check the page's status code

Print the page's status code:

```bash
curl -s -o /dev/null -w "%{http_code}" http://localhost:8092/type-echo.html
```

The command prints:

```text
200
```

{/* test end */}
````

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Check the page's status code

// (test {"testId":"custom-option-language","detectSteps":true})

Print the page's status code:

[source,bash]
----
curl -s -o /dev/null -w "%{http_code}" http://localhost:8092/type-echo.html
----

The command prints:

[source,text]
----
200
----

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the page's status code</title></head>
<body>
<!-- test {"testId":"custom-option-language","detectSteps":true} -->
<h1>Check the page's status code</h1>
<p>Print the page's status code:</p>
<pre><code class="language-bash">curl -s -o /dev/null -w "%{http_code}" http://localhost:8092/type-echo.html</code></pre>
<p>The command prints:</p>
<pre><code class="language-text">200</code></pre>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Check the page's status code
============================

.. test {"testId":"custom-option-language","detectSteps":true}

Print the page's status code:

.. code-block:: bash

   curl -s -o /dev/null -w "%{http_code}" http://localhost:8092/type-echo.html

The command prints:

.. code-block:: text

   200

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-option-language">
  <title>Check the page's status code</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-option-language","detectSteps":true}'/>
    <p>Print the page's status code:</p>
    <codeblock outputclass="language-bash">curl -s -o /dev/null -w "%{http_code}" http://localhost:8092/type-echo.html</codeblock>
    <p>The command prints:</p>
    <codeblock outputclass="language-text">200</codeblock>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Inline

#### Markdown

**`inline.md`**

````markdown title="inline.md"
<!-- test {"testId":"custom-option-language","detectSteps":false} -->

# Check the page's status code

Print the page's status code:

```bash
curl -s -o /dev/null -w "%{http_code}" http://localhost:8092/type-echo.html
```

<!-- step {"runShell":"curl -s -o /dev/null -w \"%{http_code}\" http://localhost:8092/type-echo.html"} -->

The command prints:

```text
200
```

<!-- test end -->
````

#### MDX

**`inline.mdx`**

````mdx title="inline.mdx"
{/* test {"testId":"custom-option-language","detectSteps":false} */}

# Check the page's status code

Print the page's status code:

```bash
curl -s -o /dev/null -w "%{http_code}" http://localhost:8092/type-echo.html
```

{/* step {"runShell":"curl -s -o /dev/null -w \"%{http_code}\" http://localhost:8092/type-echo.html"} */}

The command prints:

```text
200
```

{/* test end */}
````

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Check the page's status code

// (test {"testId":"custom-option-language","detectSteps":false})

Print the page's status code:

[source,bash]
----
curl -s -o /dev/null -w "%{http_code}" http://localhost:8092/type-echo.html
----

// (step {"runShell":"curl -s -o /dev/null -w \"%{http_code}\" http://localhost:8092/type-echo.html"})

The command prints:

[source,text]
----
200
----

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the page's status code</title></head>
<body>
<!-- test {"testId":"custom-option-language","detectSteps":false} -->
<h1>Check the page's status code</h1>
<p>Print the page's status code:</p>
<pre><code class="language-bash">curl -s -o /dev/null -w "%{http_code}" http://localhost:8092/type-echo.html</code></pre>
<!-- step {"runShell":"curl -s -o /dev/null -w \"%{http_code}\" http://localhost:8092/type-echo.html"} -->
<p>The command prints:</p>
<pre><code class="language-text">200</code></pre>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Check the page's status code
============================

.. test {"testId":"custom-option-language","detectSteps":false}

Print the page's status code:

.. code-block:: bash

   curl -s -o /dev/null -w "%{http_code}" http://localhost:8092/type-echo.html

.. step {"runShell":"curl -s -o /dev/null -w \"%{http_code}\" http://localhost:8092/type-echo.html"}

The command prints:

.. code-block:: text

   200

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-option-language">
  <title>Check the page's status code</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-option-language","detectSteps":false}'/>
    <p>Print the page's status code:</p>
    <codeblock outputclass="language-bash">curl -s -o /dev/null -w "%{http_code}" http://localhost:8092/type-echo.html</codeblock>
    <data name="doc-detective" value='step {"runShell":"curl -s -o /dev/null -w \"%{http_code}\" http://localhost:8092/type-echo.html"}'/>
    <p>The command prints:</p>
    <codeblock outputclass="language-text">200</codeblock>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-option-language",
      "steps": [
        {
          "runShell": "curl -s -o /dev/null -w \"%{http_code}\" http://localhost:8092/type-echo.html"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-option-language
    steps:
      - runShell: curl -s -o /dev/null -w "%{http_code}"
          http://localhost:8092/type-echo.html
```

### `metaExcludes`

**Varies:** `markup.codeBlock.metaExcludes` · **Value:** `\\bno-run\\b` · **Effect:** the `bash` block marked `no-run` doesn't run.

```json
{
  "name": "runBash",
  "codeBlock": {
    "language": [
      "bash"
    ],
    "metaExcludes": "\\bno-run\\b"
  },
  "actions": [
    "runShell"
  ]
}
```

#### Prose

#### Markdown

**`prose.md`**

````markdown title="prose.md"
# Check that the page server is up

Request the type echo page:

```bash
curl -sf -o /dev/null http://localhost:8092/type-echo.html
```

If the request fails, start the server from the repository root:

```bash no-run
node test/server/start.js
```
````

#### MDX

**`prose.mdx`**

````mdx title="prose.mdx"
# Check that the page server is up

Request the type echo page:

```bash
curl -sf -o /dev/null http://localhost:8092/type-echo.html
```

If the request fails, start the server from the repository root:

```bash no-run
node test/server/start.js
```
````

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Check that the page server is up

Request the type echo page:

[source,bash]
----
curl -sf -o /dev/null http://localhost:8092/type-echo.html
----

If the request fails, start the server from the repository root:

[source,bash,no-run]
----
node test/server/start.js
----
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Check that the page server is up
================================

Request the type echo page:

.. code-block:: bash

   curl -sf -o /dev/null http://localhost:8092/type-echo.html

If the request fails, start the server from the repository root:

.. code-block:: bash
   :class: no-run

   node test/server/start.js
```

#### Detected

#### Markdown

**`detected.md`**

````markdown title="detected.md"
<!-- test {"testId":"custom-option-metaexcludes","detectSteps":true} -->

# Check that the page server is up

Request the type echo page:

```bash
curl -sf -o /dev/null http://localhost:8092/type-echo.html
```

If the request fails, start the server from the repository root:

```bash no-run
node test/server/start.js
```

<!-- test end -->
````

#### MDX

**`detected.mdx`**

````mdx title="detected.mdx"
{/* test {"testId":"custom-option-metaexcludes","detectSteps":true} */}

# Check that the page server is up

Request the type echo page:

```bash
curl -sf -o /dev/null http://localhost:8092/type-echo.html
```

If the request fails, start the server from the repository root:

```bash no-run
node test/server/start.js
```

{/* test end */}
````

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Check that the page server is up

// (test {"testId":"custom-option-metaexcludes","detectSteps":true})

Request the type echo page:

[source,bash]
----
curl -sf -o /dev/null http://localhost:8092/type-echo.html
----

If the request fails, start the server from the repository root:

[source,bash,no-run]
----
node test/server/start.js
----

// (test end)
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Check that the page server is up
================================

.. test {"testId":"custom-option-metaexcludes","detectSteps":true}

Request the type echo page:

.. code-block:: bash

   curl -sf -o /dev/null http://localhost:8092/type-echo.html

If the request fails, start the server from the repository root:

.. code-block:: bash
   :class: no-run

   node test/server/start.js

.. test end
```

#### Inline

#### Markdown

**`inline.md`**

````markdown title="inline.md"
<!-- test {"testId":"custom-option-metaexcludes","detectSteps":false} -->

# Check that the page server is up

Request the type echo page:

```bash
curl -sf -o /dev/null http://localhost:8092/type-echo.html
```

<!-- step {"runShell":"curl -sf -o /dev/null http://localhost:8092/type-echo.html"} -->

If the request fails, start the server from the repository root:

```bash no-run
node test/server/start.js
```

<!-- test end -->
````

#### MDX

**`inline.mdx`**

````mdx title="inline.mdx"
{/* test {"testId":"custom-option-metaexcludes","detectSteps":false} */}

# Check that the page server is up

Request the type echo page:

```bash
curl -sf -o /dev/null http://localhost:8092/type-echo.html
```

{/* step {"runShell":"curl -sf -o /dev/null http://localhost:8092/type-echo.html"} */}

If the request fails, start the server from the repository root:

```bash no-run
node test/server/start.js
```

{/* test end */}
````

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Check that the page server is up

// (test {"testId":"custom-option-metaexcludes","detectSteps":false})

Request the type echo page:

[source,bash]
----
curl -sf -o /dev/null http://localhost:8092/type-echo.html
----

// (step {"runShell":"curl -sf -o /dev/null http://localhost:8092/type-echo.html"})

If the request fails, start the server from the repository root:

[source,bash,no-run]
----
node test/server/start.js
----

// (test end)
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Check that the page server is up
================================

.. test {"testId":"custom-option-metaexcludes","detectSteps":false}

Request the type echo page:

.. code-block:: bash

   curl -sf -o /dev/null http://localhost:8092/type-echo.html

.. step {"runShell":"curl -sf -o /dev/null http://localhost:8092/type-echo.html"}

If the request fails, start the server from the repository root:

.. code-block:: bash
   :class: no-run

   node test/server/start.js

.. test end
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-option-metaexcludes",
      "steps": [
        {
          "runShell": "curl -sf -o /dev/null http://localhost:8092/type-echo.html"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-option-metaexcludes
    steps:
      - runShell: curl -sf -o /dev/null http://localhost:8092/type-echo.html
```

HTML and DITA code blocks have no text after the language, so this example leaves them out. The meta is `bash no-run` in Markdown, `[source,bash,no-run]` in AsciiDoc, and `:class: no-run` in reStructuredText.

### `url`

**Varies:** `markup.link.url` · **Value:** `^http://localhost:8092/` · **Effect:** only the link to the test server gets a `checkLink`. The `#next-steps` link doesn't.

```json
{
  "name": "checkLocalLinks",
  "link": {
    "url": "^http://localhost:8092/"
  },
  "captures": [
    "url"
  ],
  "actions": [
    "checkLink"
  ]
}
```

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Check the page's links

Open [the type echo page](http://localhost:8092/type-echo.html). For more, see [Next steps](#next-steps).
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Check the page's links

Open [the type echo page](http://localhost:8092/type-echo.html). For more, see [Next steps](#next-steps).
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Check the page's links

Open http://localhost:8092/type-echo.html[the type echo page]. For more, see link:#next-steps[Next steps].
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the page's links</title></head>
<body>
<h1>Check the page's links</h1>
<p>Open <a href="http://localhost:8092/type-echo.html">the type echo page</a>. For more, see <a href="#next-steps">Next steps</a>.</p>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Check the page's links
======================

Open `the type echo page <http://localhost:8092/type-echo.html>`__. For more, see `Next steps <#next-steps>`__.
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"custom-option-url","detectSteps":true} -->

# Check the page's links

Open [the type echo page](http://localhost:8092/type-echo.html). For more, see [Next steps](#next-steps).

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"custom-option-url","detectSteps":true} */}

# Check the page's links

Open [the type echo page](http://localhost:8092/type-echo.html). For more, see [Next steps](#next-steps).

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Check the page's links

// (test {"testId":"custom-option-url","detectSteps":true})

Open http://localhost:8092/type-echo.html[the type echo page]. For more, see link:#next-steps[Next steps].

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the page's links</title></head>
<body>
<!-- test {"testId":"custom-option-url","detectSteps":true} -->
<h1>Check the page's links</h1>
<p>Open <a href="http://localhost:8092/type-echo.html">the type echo page</a>. For more, see <a href="#next-steps">Next steps</a>.</p>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Check the page's links
======================

.. test {"testId":"custom-option-url","detectSteps":true}

Open `the type echo page <http://localhost:8092/type-echo.html>`__. For more, see `Next steps <#next-steps>`__.

.. test end
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"custom-option-url","detectSteps":false} -->

# Check the page's links

Open [the type echo page](http://localhost:8092/type-echo.html). For more, see [Next steps](#next-steps).

<!-- step {"checkLink":"http://localhost:8092/type-echo.html"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"custom-option-url","detectSteps":false} */}

# Check the page's links

Open [the type echo page](http://localhost:8092/type-echo.html). For more, see [Next steps](#next-steps).

{/* step {"checkLink":"http://localhost:8092/type-echo.html"} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Check the page's links

// (test {"testId":"custom-option-url","detectSteps":false})

Open http://localhost:8092/type-echo.html[the type echo page]. For more, see link:#next-steps[Next steps].

// (step {"checkLink":"http://localhost:8092/type-echo.html"})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the page's links</title></head>
<body>
<!-- test {"testId":"custom-option-url","detectSteps":false} -->
<h1>Check the page's links</h1>
<p>Open <a href="http://localhost:8092/type-echo.html">the type echo page</a>. For more, see <a href="#next-steps">Next steps</a>.</p>
<!-- step {"checkLink":"http://localhost:8092/type-echo.html"} -->
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Check the page's links
======================

.. test {"testId":"custom-option-url","detectSteps":false}

Open `the type echo page <http://localhost:8092/type-echo.html>`__. For more, see `Next steps <#next-steps>`__.

.. step {"checkLink":"http://localhost:8092/type-echo.html"}

.. test end
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-option-url",
      "steps": [
        {
          "checkLink": "http://localhost:8092/type-echo.html"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-option-url
    steps:
      - checkLink: http://localhost:8092/type-echo.html
```

DITA has no `link` nodes, so this example leaves it out.

### `src`

**Varies:** `markup.image.src` · **Value:** `\\.svg$` · **Effect:** only the SVG icon gets a `checkLink`. The PNG chart doesn't.

```json
{
  "name": "checkSvg",
  "image": {
    "src": "\\.svg$"
  },
  "captures": [
    "src"
  ],
  "actions": [
    "checkLink"
  ]
}
```

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Check a hosted icon

The page uses this icon and chart:

![Target icon](http://localhost:8092/find-image-target.svg)

![Chart](http://localhost:8092/find-image-chart.png)
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Check a hosted icon

The page uses this icon and chart:

![Target icon](http://localhost:8092/find-image-target.svg)

![Chart](http://localhost:8092/find-image-chart.png)
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Check a hosted icon

The page uses this icon and chart:

image::http://localhost:8092/find-image-target.svg[Target icon]

image::http://localhost:8092/find-image-chart.png[Chart]
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check a hosted icon</title></head>
<body>
<h1>Check a hosted icon</h1>
<p>The page uses this icon and chart:</p>
<p><img src="http://localhost:8092/find-image-target.svg" alt="Target icon"></p>
<p><img src="http://localhost:8092/find-image-chart.png" alt="Chart"></p>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Check a hosted icon
===================

The page uses this icon and chart:

.. image:: http://localhost:8092/find-image-target.svg
   :alt: Target icon

.. image:: http://localhost:8092/find-image-chart.png
   :alt: Chart
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-option-src">
  <title>Check a hosted icon</title>
  <body>
    <p>The page uses this icon and chart:</p>
    <image href="http://localhost:8092/find-image-target.svg"><alt>Target icon</alt></image>
    <image href="http://localhost:8092/find-image-chart.png"><alt>Chart</alt></image>
  </body>
</topic>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"custom-option-src","detectSteps":true} -->

# Check a hosted icon

The page uses this icon and chart:

![Target icon](http://localhost:8092/find-image-target.svg)

![Chart](http://localhost:8092/find-image-chart.png)

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"custom-option-src","detectSteps":true} */}

# Check a hosted icon

The page uses this icon and chart:

![Target icon](http://localhost:8092/find-image-target.svg)

![Chart](http://localhost:8092/find-image-chart.png)

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Check a hosted icon

// (test {"testId":"custom-option-src","detectSteps":true})

The page uses this icon and chart:

image::http://localhost:8092/find-image-target.svg[Target icon]

image::http://localhost:8092/find-image-chart.png[Chart]

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check a hosted icon</title></head>
<body>
<!-- test {"testId":"custom-option-src","detectSteps":true} -->
<h1>Check a hosted icon</h1>
<p>The page uses this icon and chart:</p>
<p><img src="http://localhost:8092/find-image-target.svg" alt="Target icon"></p>
<p><img src="http://localhost:8092/find-image-chart.png" alt="Chart"></p>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Check a hosted icon
===================

.. test {"testId":"custom-option-src","detectSteps":true}

The page uses this icon and chart:

.. image:: http://localhost:8092/find-image-target.svg
   :alt: Target icon

.. image:: http://localhost:8092/find-image-chart.png
   :alt: Chart

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-option-src">
  <title>Check a hosted icon</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-option-src","detectSteps":true}'/>
    <p>The page uses this icon and chart:</p>
    <image href="http://localhost:8092/find-image-target.svg"><alt>Target icon</alt></image>
    <image href="http://localhost:8092/find-image-chart.png"><alt>Chart</alt></image>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"custom-option-src","detectSteps":false} -->

# Check a hosted icon

The page uses this icon and chart:

![Target icon](http://localhost:8092/find-image-target.svg)

<!-- step {"checkLink":"http://localhost:8092/find-image-target.svg"} -->

![Chart](http://localhost:8092/find-image-chart.png)

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"custom-option-src","detectSteps":false} */}

# Check a hosted icon

The page uses this icon and chart:

![Target icon](http://localhost:8092/find-image-target.svg)

{/* step {"checkLink":"http://localhost:8092/find-image-target.svg"} */}

![Chart](http://localhost:8092/find-image-chart.png)

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Check a hosted icon

// (test {"testId":"custom-option-src","detectSteps":false})

The page uses this icon and chart:

image::http://localhost:8092/find-image-target.svg[Target icon]

// (step {"checkLink":"http://localhost:8092/find-image-target.svg"})

image::http://localhost:8092/find-image-chart.png[Chart]

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check a hosted icon</title></head>
<body>
<!-- test {"testId":"custom-option-src","detectSteps":false} -->
<h1>Check a hosted icon</h1>
<p>The page uses this icon and chart:</p>
<p><img src="http://localhost:8092/find-image-target.svg" alt="Target icon"></p>
<!-- step {"checkLink":"http://localhost:8092/find-image-target.svg"} -->
<p><img src="http://localhost:8092/find-image-chart.png" alt="Chart"></p>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Check a hosted icon
===================

.. test {"testId":"custom-option-src","detectSteps":false}

The page uses this icon and chart:

.. image:: http://localhost:8092/find-image-target.svg
   :alt: Target icon

.. step {"checkLink":"http://localhost:8092/find-image-target.svg"}

.. image:: http://localhost:8092/find-image-chart.png
   :alt: Chart

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-option-src">
  <title>Check a hosted icon</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-option-src","detectSteps":false}'/>
    <p>The page uses this icon and chart:</p>
    <image href="http://localhost:8092/find-image-target.svg"><alt>Target icon</alt></image>
    <data name="doc-detective" value='step {"checkLink":"http://localhost:8092/find-image-target.svg"}'/>
    <image href="http://localhost:8092/find-image-chart.png"><alt>Chart</alt></image>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-option-src",
      "steps": [
        {
          "checkLink": "http://localhost:8092/find-image-target.svg"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-option-src
    steps:
      - checkLink: http://localhost:8092/find-image-target.svg
```

### `tag`

**Varies:** `markup.element.tag` · **Value:** `["samp", "systemoutput"]` · **Effect:** a `<samp>` element in Markdown, MDX, and HTML, or a `<systemoutput>` element in DITA, becomes a `find`.

```json
{
  "name": "findSample",
  "element": {
    "tag": [
      "samp",
      "systemoutput"
    ]
  },
  "actions": [
    "find"
  ]
}
```

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Check the field label

Open the type echo page.

The page shows <samp>Type here:</samp> next to the field.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Check the field label

Open the type echo page.

The page shows <samp>Type here:</samp> next to the field.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the field label</title></head>
<body>
<h1>Check the field label</h1>
<p>Open the type echo page.</p>
<p>The page shows <samp>Type here:</samp> next to the field.</p>
</body>
</html>
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-option-tag">
  <title>Check the field label</title>
  <body>
    <p>Open the type echo page.</p>
    <p>The page shows <systemoutput>Type here:</systemoutput> next to the field.</p>
  </body>
</topic>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"custom-option-tag","detectSteps":true} -->

# Check the field label

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

The page shows <samp>Type here:</samp> next to the field.

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"custom-option-tag","detectSteps":true} */}

# Check the field label

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

The page shows <samp>Type here:</samp> next to the field.

{/* test end */}
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the field label</title></head>
<body>
<!-- test {"testId":"custom-option-tag","detectSteps":true} -->
<h1>Check the field label</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>The page shows <samp>Type here:</samp> next to the field.</p>
<!-- test end -->
</body>
</html>
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-option-tag">
  <title>Check the field label</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-option-tag","detectSteps":true}'/>
    <p>Open the type echo page.</p>
    <data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/>
    <p>The page shows <systemoutput>Type here:</systemoutput> next to the field.</p>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"custom-option-tag","detectSteps":false} -->

# Check the field label

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

The page shows <samp>Type here:</samp> next to the field.

<!-- step {"find":"Type here:"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"custom-option-tag","detectSteps":false} */}

# Check the field label

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

The page shows <samp>Type here:</samp> next to the field.

{/* step {"find":"Type here:"} */}

{/* test end */}
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the field label</title></head>
<body>
<!-- test {"testId":"custom-option-tag","detectSteps":false} -->
<h1>Check the field label</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>The page shows <samp>Type here:</samp> next to the field.</p>
<!-- step {"find":"Type here:"} -->
<!-- test end -->
</body>
</html>
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-option-tag">
  <title>Check the field label</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-option-tag","detectSteps":false}'/>
    <p>Open the type echo page.</p>
    <data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/>
    <p>The page shows <systemoutput>Type here:</systemoutput> next to the field.</p>
    <data name="doc-detective" value='step {"find":"Type here:"}'/>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-option-tag",
      "steps": [
        {
          "goTo": "http://localhost:8092/type-echo.html"
        },
        {
          "find": "Type here:"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-option-tag
    steps:
      - goTo: http://localhost:8092/type-echo.html
      - find: "Type here:"
```

AsciiDoc and reStructuredText produce no `element` nodes, so this example leaves them out.

## `actions` permutations

Each example uses a bold phrase or an italic phrase and changes only the form of `actions`.

### An action name

**Varies:** `markup.actions` · **Value:** `["click"]` · **Effect:** the action takes `$1` as its value, so detection clicks the bold phrase.

```json
{
  "name": "clickBold",
  "strong": {},
  "actions": [
    "click"
  ]
}
```

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Click the field

Open the type echo page.

Click **Type here:**.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Click the field

Open the type echo page.

Click **Type here:**.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Click the field

Open the type echo page.

Click *Type here:*.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Click the field</title></head>
<body>
<h1>Click the field</h1>
<p>Open the type echo page.</p>
<p>Click <strong>Type here:</strong>.</p>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Click the field
===============

Open the type echo page.

Click **Type here:**.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-actions-name">
  <title>Click the field</title>
  <body>
    <p>Open the type echo page.</p>
    <p>Click <b>Type here:</b>.</p>
  </body>
</topic>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"custom-actions-name","detectSteps":true} -->

# Click the field

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

Click **Type here:**.

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"custom-actions-name","detectSteps":true} */}

# Click the field

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

Click **Type here:**.

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Click the field

// (test {"testId":"custom-actions-name","detectSteps":true})

Open the type echo page.

// (step {"goTo":"http://localhost:8092/type-echo.html"})

Click *Type here:*.

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Click the field</title></head>
<body>
<!-- test {"testId":"custom-actions-name","detectSteps":true} -->
<h1>Click the field</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>Click <strong>Type here:</strong>.</p>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Click the field
===============

.. test {"testId":"custom-actions-name","detectSteps":true}

Open the type echo page.

.. step {"goTo":"http://localhost:8092/type-echo.html"}

Click **Type here:**.

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-actions-name">
  <title>Click the field</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-actions-name","detectSteps":true}'/>
    <p>Open the type echo page.</p>
    <data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/>
    <p>Click <b>Type here:</b>.</p>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"custom-actions-name","detectSteps":false} -->

# Click the field

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

Click **Type here:**.

<!-- step {"click":"Type here:"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"custom-actions-name","detectSteps":false} */}

# Click the field

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

Click **Type here:**.

{/* step {"click":"Type here:"} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Click the field

// (test {"testId":"custom-actions-name","detectSteps":false})

Open the type echo page.

// (step {"goTo":"http://localhost:8092/type-echo.html"})

Click *Type here:*.

// (step {"click":"Type here:"})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Click the field</title></head>
<body>
<!-- test {"testId":"custom-actions-name","detectSteps":false} -->
<h1>Click the field</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>Click <strong>Type here:</strong>.</p>
<!-- step {"click":"Type here:"} -->
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Click the field
===============

.. test {"testId":"custom-actions-name","detectSteps":false}

Open the type echo page.

.. step {"goTo":"http://localhost:8092/type-echo.html"}

Click **Type here:**.

.. step {"click":"Type here:"}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-actions-name">
  <title>Click the field</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-actions-name","detectSteps":false}'/>
    <p>Open the type echo page.</p>
    <data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/>
    <p>Click <b>Type here:</b>.</p>
    <data name="doc-detective" value='step {"click":"Type here:"}'/>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-actions-name",
      "steps": [
        {
          "goTo": "http://localhost:8092/type-echo.html"
        },
        {
          "click": "Type here:"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-actions-name
    steps:
      - goTo: http://localhost:8092/type-echo.html
      - click: "Type here:"
```

### An action name as a string

**Varies:** `markup.actions` · **Value:** `"click"` · **Effect:** a single action can skip the array. Detection clicks the bold phrase, as with `["click"]`.

```json
{
  "name": "clickBold",
  "strong": {},
  "actions": "click"
}
```

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Click the field

Open the type echo page.

Click **Type here:**.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Click the field

Open the type echo page.

Click **Type here:**.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Click the field

Open the type echo page.

Click *Type here:*.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Click the field</title></head>
<body>
<h1>Click the field</h1>
<p>Open the type echo page.</p>
<p>Click <strong>Type here:</strong>.</p>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Click the field
===============

Open the type echo page.

Click **Type here:**.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-actions-string">
  <title>Click the field</title>
  <body>
    <p>Open the type echo page.</p>
    <p>Click <b>Type here:</b>.</p>
  </body>
</topic>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"custom-actions-string","detectSteps":true} -->

# Click the field

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

Click **Type here:**.

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"custom-actions-string","detectSteps":true} */}

# Click the field

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

Click **Type here:**.

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Click the field

// (test {"testId":"custom-actions-string","detectSteps":true})

Open the type echo page.

// (step {"goTo":"http://localhost:8092/type-echo.html"})

Click *Type here:*.

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Click the field</title></head>
<body>
<!-- test {"testId":"custom-actions-string","detectSteps":true} -->
<h1>Click the field</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>Click <strong>Type here:</strong>.</p>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Click the field
===============

.. test {"testId":"custom-actions-string","detectSteps":true}

Open the type echo page.

.. step {"goTo":"http://localhost:8092/type-echo.html"}

Click **Type here:**.

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-actions-string">
  <title>Click the field</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-actions-string","detectSteps":true}'/>
    <p>Open the type echo page.</p>
    <data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/>
    <p>Click <b>Type here:</b>.</p>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"custom-actions-string","detectSteps":false} -->

# Click the field

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

Click **Type here:**.

<!-- step {"click":"Type here:"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"custom-actions-string","detectSteps":false} */}

# Click the field

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

Click **Type here:**.

{/* step {"click":"Type here:"} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Click the field

// (test {"testId":"custom-actions-string","detectSteps":false})

Open the type echo page.

// (step {"goTo":"http://localhost:8092/type-echo.html"})

Click *Type here:*.

// (step {"click":"Type here:"})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Click the field</title></head>
<body>
<!-- test {"testId":"custom-actions-string","detectSteps":false} -->
<h1>Click the field</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>Click <strong>Type here:</strong>.</p>
<!-- step {"click":"Type here:"} -->
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Click the field
===============

.. test {"testId":"custom-actions-string","detectSteps":false}

Open the type echo page.

.. step {"goTo":"http://localhost:8092/type-echo.html"}

Click **Type here:**.

.. step {"click":"Type here:"}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-actions-string">
  <title>Click the field</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-actions-string","detectSteps":false}'/>
    <p>Open the type echo page.</p>
    <data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/>
    <p>Click <b>Type here:</b>.</p>
    <data name="doc-detective" value='step {"click":"Type here:"}'/>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-actions-string",
      "steps": [
        {
          "goTo": "http://localhost:8092/type-echo.html"
        },
        {
          "click": "Type here:"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-actions-string
    steps:
      - goTo: http://localhost:8092/type-echo.html
      - click: "Type here:"
```

### A step template

**Varies:** `markup.actions` · **Value:** `[{ "find": { "elementText": "$1", "timeout": 5000 } }]` · **Effect:** `$1` fills a field of a full step, so the `find` sets its own `timeout`.

```json
{
  "name": "findBold",
  "strong": {},
  "actions": [
    {
      "find": {
        "elementText": "$1",
        "timeout": 5000
      }
    }
  ]
}
```

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Check the field label

Open the type echo page.

The field is labeled **Type here:**.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Check the field label

Open the type echo page.

The field is labeled **Type here:**.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Check the field label

Open the type echo page.

The field is labeled *Type here:*.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the field label</title></head>
<body>
<h1>Check the field label</h1>
<p>Open the type echo page.</p>
<p>The field is labeled <strong>Type here:</strong>.</p>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Check the field label
=====================

Open the type echo page.

The field is labeled **Type here:**.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-actions-template">
  <title>Check the field label</title>
  <body>
    <p>Open the type echo page.</p>
    <p>The field is labeled <b>Type here:</b>.</p>
  </body>
</topic>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"custom-actions-template","detectSteps":true} -->

# Check the field label

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

The field is labeled **Type here:**.

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"custom-actions-template","detectSteps":true} */}

# Check the field label

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

The field is labeled **Type here:**.

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Check the field label

// (test {"testId":"custom-actions-template","detectSteps":true})

Open the type echo page.

// (step {"goTo":"http://localhost:8092/type-echo.html"})

The field is labeled *Type here:*.

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the field label</title></head>
<body>
<!-- test {"testId":"custom-actions-template","detectSteps":true} -->
<h1>Check the field label</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>The field is labeled <strong>Type here:</strong>.</p>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Check the field label
=====================

.. test {"testId":"custom-actions-template","detectSteps":true}

Open the type echo page.

.. step {"goTo":"http://localhost:8092/type-echo.html"}

The field is labeled **Type here:**.

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-actions-template">
  <title>Check the field label</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-actions-template","detectSteps":true}'/>
    <p>Open the type echo page.</p>
    <data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/>
    <p>The field is labeled <b>Type here:</b>.</p>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"custom-actions-template","detectSteps":false} -->

# Check the field label

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

The field is labeled **Type here:**.

<!-- step {"find":{"elementText":"Type here:","timeout":5000}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"custom-actions-template","detectSteps":false} */}

# Check the field label

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

The field is labeled **Type here:**.

{/* step {"find":{"elementText":"Type here:","timeout":5000}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Check the field label

// (test {"testId":"custom-actions-template","detectSteps":false})

Open the type echo page.

// (step {"goTo":"http://localhost:8092/type-echo.html"})

The field is labeled *Type here:*.

// (step {"find":{"elementText":"Type here:","timeout":5000}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the field label</title></head>
<body>
<!-- test {"testId":"custom-actions-template","detectSteps":false} -->
<h1>Check the field label</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>The field is labeled <strong>Type here:</strong>.</p>
<!-- step {"find":{"elementText":"Type here:","timeout":5000}} -->
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Check the field label
=====================

.. test {"testId":"custom-actions-template","detectSteps":false}

Open the type echo page.

.. step {"goTo":"http://localhost:8092/type-echo.html"}

The field is labeled **Type here:**.

.. step {"find":{"elementText":"Type here:","timeout":5000}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-actions-template">
  <title>Check the field label</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-actions-template","detectSteps":false}'/>
    <p>Open the type echo page.</p>
    <data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/>
    <p>The field is labeled <b>Type here:</b>.</p>
    <data name="doc-detective" value='step {"find":{"elementText":"Type here:","timeout":5000}}'/>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-actions-template",
      "steps": [
        {
          "goTo": "http://localhost:8092/type-echo.html"
        },
        {
          "find": {
            "elementText": "Type here:",
            "timeout": 5000
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-actions-template
    steps:
      - goTo: http://localhost:8092/type-echo.html
      - find:
          elementText: "Type here:"
          timeout: 5000
```

### A step with no `$1`

**Varies:** `markup.actions` · **Value:** `[{ "wait": 500 }]` · **Effect:** each match adds the same step. The italic phrase only marks where the wait goes.

```json
{
  "name": "waitForEcho",
  "emphasis": {},
  "actions": [
    {
      "wait": 500
    }
  ]
}
```

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Wait for the echo

Open the type echo page.

Type Hello, Doc Detective.

Wait _a moment_ for the echo.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Wait for the echo

Open the type echo page.

Type Hello, Doc Detective.

Wait _a moment_ for the echo.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Wait for the echo

Open the type echo page.

Type Hello, Doc Detective.

Wait _a moment_ for the echo.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Wait for the echo</title></head>
<body>
<h1>Wait for the echo</h1>
<p>Open the type echo page.</p>
<p>Type Hello, Doc Detective.</p>
<p>Wait <em>a moment</em> for the echo.</p>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Wait for the echo
=================

Open the type echo page.

Type Hello, Doc Detective.

Wait *a moment* for the echo.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-actions-object">
  <title>Wait for the echo</title>
  <body>
    <p>Open the type echo page.</p>
    <p>Type Hello, Doc Detective.</p>
    <p>Wait <i>a moment</i> for the echo.</p>
  </body>
</topic>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"custom-actions-object","detectSteps":true} -->

# Wait for the echo

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

Type Hello, Doc Detective.

<!-- step {"type":"Hello, Doc Detective"} -->

Wait _a moment_ for the echo.

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"custom-actions-object","detectSteps":true} */}

# Wait for the echo

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

Type Hello, Doc Detective.

{/* step {"type":"Hello, Doc Detective"} */}

Wait _a moment_ for the echo.

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Wait for the echo

// (test {"testId":"custom-actions-object","detectSteps":true})

Open the type echo page.

// (step {"goTo":"http://localhost:8092/type-echo.html"})

Type Hello, Doc Detective.

// (step {"type":"Hello, Doc Detective"})

Wait _a moment_ for the echo.

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Wait for the echo</title></head>
<body>
<!-- test {"testId":"custom-actions-object","detectSteps":true} -->
<h1>Wait for the echo</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>Type Hello, Doc Detective.</p>
<!-- step {"type":"Hello, Doc Detective"} -->
<p>Wait <em>a moment</em> for the echo.</p>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Wait for the echo
=================

.. test {"testId":"custom-actions-object","detectSteps":true}

Open the type echo page.

.. step {"goTo":"http://localhost:8092/type-echo.html"}

Type Hello, Doc Detective.

.. step {"type":"Hello, Doc Detective"}

Wait *a moment* for the echo.

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-actions-object">
  <title>Wait for the echo</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-actions-object","detectSteps":true}'/>
    <p>Open the type echo page.</p>
    <data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/>
    <p>Type Hello, Doc Detective.</p>
    <data name="doc-detective" value='step {"type":"Hello, Doc Detective"}'/>
    <p>Wait <i>a moment</i> for the echo.</p>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"custom-actions-object","detectSteps":false} -->

# Wait for the echo

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

Type Hello, Doc Detective.

<!-- step {"type":"Hello, Doc Detective"} -->

Wait _a moment_ for the echo.

<!-- step {"wait":500} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"custom-actions-object","detectSteps":false} */}

# Wait for the echo

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

Type Hello, Doc Detective.

{/* step {"type":"Hello, Doc Detective"} */}

Wait _a moment_ for the echo.

{/* step {"wait":500} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Wait for the echo

// (test {"testId":"custom-actions-object","detectSteps":false})

Open the type echo page.

// (step {"goTo":"http://localhost:8092/type-echo.html"})

Type Hello, Doc Detective.

// (step {"type":"Hello, Doc Detective"})

Wait _a moment_ for the echo.

// (step {"wait":500})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Wait for the echo</title></head>
<body>
<!-- test {"testId":"custom-actions-object","detectSteps":false} -->
<h1>Wait for the echo</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>Type Hello, Doc Detective.</p>
<!-- step {"type":"Hello, Doc Detective"} -->
<p>Wait <em>a moment</em> for the echo.</p>
<!-- step {"wait":500} -->
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Wait for the echo
=================

.. test {"testId":"custom-actions-object","detectSteps":false}

Open the type echo page.

.. step {"goTo":"http://localhost:8092/type-echo.html"}

Type Hello, Doc Detective.

.. step {"type":"Hello, Doc Detective"}

Wait *a moment* for the echo.

.. step {"wait":500}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-actions-object">
  <title>Wait for the echo</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-actions-object","detectSteps":false}'/>
    <p>Open the type echo page.</p>
    <data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/>
    <p>Type Hello, Doc Detective.</p>
    <data name="doc-detective" value='step {"type":"Hello, Doc Detective"}'/>
    <p>Wait <i>a moment</i> for the echo.</p>
    <data name="doc-detective" value='step {"wait":500}'/>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-actions-object",
      "steps": [
        {
          "goTo": "http://localhost:8092/type-echo.html"
        },
        {
          "type": "Hello, Doc Detective"
        },
        {
          "wait": 500
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-actions-object
    steps:
      - goTo: http://localhost:8092/type-echo.html
      - type: Hello, Doc Detective
      - wait: 500
```

## `extends` permutations

Both examples use the same procedure and the same definition, which finds italic text. Only the file type's form changes.

### `extends`

**Varies:** `fileTypes.extends` · **Value:** `markdown` · **Effect:** the built-in definitions run too, so the bold label also becomes a `find`.

```json
{
  "extends": "markdown",
  "markup": [
    {
      "name": "findItalic",
      "emphasis": {},
      "actions": [
        "find"
      ]
    }
  ]
}
```

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Check the page heading

Open the type echo page.

The field is labeled **Type here:**.

The heading reads _Type Echo Test Page_.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Check the page heading

Open the type echo page.

The field is labeled **Type here:**.

The heading reads _Type Echo Test Page_.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Check the page heading

Open the type echo page.

The field is labeled *Type here:*.

The heading reads _Type Echo Test Page_.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the page heading</title></head>
<body>
<h1>Check the page heading</h1>
<p>Open the type echo page.</p>
<p>The field is labeled <strong>Type here:</strong>.</p>
<p>The heading reads <em>Type Echo Test Page</em>.</p>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Check the page heading
======================

Open the type echo page.

The field is labeled **Type here:**.

The heading reads *Type Echo Test Page*.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-filetype-extends">
  <title>Check the page heading</title>
  <body>
    <p>Open the type echo page.</p>
    <p>The field is labeled <b>Type here:</b>.</p>
    <p>The heading reads <i>Type Echo Test Page</i>.</p>
  </body>
</topic>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"custom-filetype-extends","detectSteps":true} -->

# Check the page heading

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

The field is labeled **Type here:**.

The heading reads _Type Echo Test Page_.

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"custom-filetype-extends","detectSteps":true} */}

# Check the page heading

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

The field is labeled **Type here:**.

The heading reads _Type Echo Test Page_.

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Check the page heading

// (test {"testId":"custom-filetype-extends","detectSteps":true})

Open the type echo page.

// (step {"goTo":"http://localhost:8092/type-echo.html"})

The field is labeled *Type here:*.

The heading reads _Type Echo Test Page_.

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the page heading</title></head>
<body>
<!-- test {"testId":"custom-filetype-extends","detectSteps":true} -->
<h1>Check the page heading</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>The field is labeled <strong>Type here:</strong>.</p>
<p>The heading reads <em>Type Echo Test Page</em>.</p>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Check the page heading
======================

.. test {"testId":"custom-filetype-extends","detectSteps":true}

Open the type echo page.

.. step {"goTo":"http://localhost:8092/type-echo.html"}

The field is labeled **Type here:**.

The heading reads *Type Echo Test Page*.

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-filetype-extends">
  <title>Check the page heading</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-filetype-extends","detectSteps":true}'/>
    <p>Open the type echo page.</p>
    <data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/>
    <p>The field is labeled <b>Type here:</b>.</p>
    <p>The heading reads <i>Type Echo Test Page</i>.</p>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"custom-filetype-extends","detectSteps":false} -->

# Check the page heading

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

The field is labeled **Type here:**.

The heading reads _Type Echo Test Page_.

<!-- step {"find":"Type Echo Test Page"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"custom-filetype-extends","detectSteps":false} */}

# Check the page heading

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

The field is labeled **Type here:**.

The heading reads _Type Echo Test Page_.

{/* step {"find":"Type Echo Test Page"} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Check the page heading

// (test {"testId":"custom-filetype-extends","detectSteps":false})

Open the type echo page.

// (step {"goTo":"http://localhost:8092/type-echo.html"})

The field is labeled *Type here:*.

The heading reads _Type Echo Test Page_.

// (step {"find":"Type Echo Test Page"})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the page heading</title></head>
<body>
<!-- test {"testId":"custom-filetype-extends","detectSteps":false} -->
<h1>Check the page heading</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>The field is labeled <strong>Type here:</strong>.</p>
<p>The heading reads <em>Type Echo Test Page</em>.</p>
<!-- step {"find":"Type Echo Test Page"} -->
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Check the page heading
======================

.. test {"testId":"custom-filetype-extends","detectSteps":false}

Open the type echo page.

.. step {"goTo":"http://localhost:8092/type-echo.html"}

The field is labeled **Type here:**.

The heading reads *Type Echo Test Page*.

.. step {"find":"Type Echo Test Page"}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-filetype-extends">
  <title>Check the page heading</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-filetype-extends","detectSteps":false}'/>
    <p>Open the type echo page.</p>
    <data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/>
    <p>The field is labeled <b>Type here:</b>.</p>
    <p>The heading reads <i>Type Echo Test Page</i>.</p>
    <data name="doc-detective" value='step {"find":"Type Echo Test Page"}'/>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-filetype-extends",
      "steps": [
        {
          "goTo": "http://localhost:8092/type-echo.html"
        },
        {
          "find": "Type Echo Test Page"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-filetype-extends
    steps:
      - goTo: http://localhost:8092/type-echo.html
      - find: Type Echo Test Page
```

### From scratch

**Varies:** `fileTypes.extends` · **Value:** `(not set)` · **Effect:** only the custom definition runs, so the bold label is plain text. The file type needs its own `extensions` and `inlineStatements`.

```json
{
  "name": "markdown-custom",
  "extensions": [
    "md",
    "mdx"
  ],
  "inlineStatements": {
    "in": [
      "comment"
    ]
  },
  "markup": [
    {
      "name": "findItalic",
      "emphasis": {},
      "actions": [
        "find"
      ]
    }
  ]
}
```

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Check the page heading

Open the type echo page.

The field is labeled **Type here:**.

The heading reads _Type Echo Test Page_.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Check the page heading

Open the type echo page.

The field is labeled **Type here:**.

The heading reads _Type Echo Test Page_.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Check the page heading

Open the type echo page.

The field is labeled *Type here:*.

The heading reads _Type Echo Test Page_.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the page heading</title></head>
<body>
<h1>Check the page heading</h1>
<p>Open the type echo page.</p>
<p>The field is labeled <strong>Type here:</strong>.</p>
<p>The heading reads <em>Type Echo Test Page</em>.</p>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Check the page heading
======================

Open the type echo page.

The field is labeled **Type here:**.

The heading reads *Type Echo Test Page*.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-filetype-scratch">
  <title>Check the page heading</title>
  <body>
    <p>Open the type echo page.</p>
    <p>The field is labeled <b>Type here:</b>.</p>
    <p>The heading reads <i>Type Echo Test Page</i>.</p>
  </body>
</topic>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"custom-filetype-scratch","detectSteps":true} -->

# Check the page heading

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

The field is labeled **Type here:**.

The heading reads _Type Echo Test Page_.

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"custom-filetype-scratch","detectSteps":true} */}

# Check the page heading

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

The field is labeled **Type here:**.

The heading reads _Type Echo Test Page_.

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Check the page heading

// (test {"testId":"custom-filetype-scratch","detectSteps":true})

Open the type echo page.

// (step {"goTo":"http://localhost:8092/type-echo.html"})

The field is labeled *Type here:*.

The heading reads _Type Echo Test Page_.

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the page heading</title></head>
<body>
<!-- test {"testId":"custom-filetype-scratch","detectSteps":true} -->
<h1>Check the page heading</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>The field is labeled <strong>Type here:</strong>.</p>
<p>The heading reads <em>Type Echo Test Page</em>.</p>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Check the page heading
======================

.. test {"testId":"custom-filetype-scratch","detectSteps":true}

Open the type echo page.

.. step {"goTo":"http://localhost:8092/type-echo.html"}

The field is labeled **Type here:**.

The heading reads *Type Echo Test Page*.

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-filetype-scratch">
  <title>Check the page heading</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-filetype-scratch","detectSteps":true}'/>
    <p>Open the type echo page.</p>
    <data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/>
    <p>The field is labeled <b>Type here:</b>.</p>
    <p>The heading reads <i>Type Echo Test Page</i>.</p>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"custom-filetype-scratch","detectSteps":false} -->

# Check the page heading

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

The field is labeled **Type here:**.

The heading reads _Type Echo Test Page_.

<!-- step {"find":"Type Echo Test Page"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"custom-filetype-scratch","detectSteps":false} */}

# Check the page heading

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

The field is labeled **Type here:**.

The heading reads _Type Echo Test Page_.

{/* step {"find":"Type Echo Test Page"} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Check the page heading

// (test {"testId":"custom-filetype-scratch","detectSteps":false})

Open the type echo page.

// (step {"goTo":"http://localhost:8092/type-echo.html"})

The field is labeled *Type here:*.

The heading reads _Type Echo Test Page_.

// (step {"find":"Type Echo Test Page"})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the page heading</title></head>
<body>
<!-- test {"testId":"custom-filetype-scratch","detectSteps":false} -->
<h1>Check the page heading</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>The field is labeled <strong>Type here:</strong>.</p>
<p>The heading reads <em>Type Echo Test Page</em>.</p>
<!-- step {"find":"Type Echo Test Page"} -->
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Check the page heading
======================

.. test {"testId":"custom-filetype-scratch","detectSteps":false}

Open the type echo page.

.. step {"goTo":"http://localhost:8092/type-echo.html"}

The field is labeled **Type here:**.

The heading reads *Type Echo Test Page*.

.. step {"find":"Type Echo Test Page"}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-filetype-scratch">
  <title>Check the page heading</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-filetype-scratch","detectSteps":false}'/>
    <p>Open the type echo page.</p>
    <data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/>
    <p>The field is labeled <b>Type here:</b>.</p>
    <p>The heading reads <i>Type Echo Test Page</i>.</p>
    <data name="doc-detective" value='step {"find":"Type Echo Test Page"}'/>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-filetype-scratch",
      "steps": [
        {
          "goTo": "http://localhost:8092/type-echo.html"
        },
        {
          "find": "Type Echo Test Page"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-filetype-scratch
    steps:
      - goTo: http://localhost:8092/type-echo.html
      - find: Type Echo Test Page
```

## `runShell` file type permutations

A file type with `runShell` doesn't detect steps. Each matching file becomes one test with one [`runShell`](/docs/actions/runshell) step, and `$1` is the file's absolute path. These examples run a Node.js check that fails when a release-notes file still says `TODO`. The detected variant is the whole file, so prose and detected are the same text. The examples leave out the other formats and the inline variant, because the file type runs every `.txt` file it matches.

### `runShell` as a string

**Varies:** `fileTypes.runShell` · **Value:** `"node -e \"…\" $1"` · **Effect:** runs the command with `$1` unquoted. On Windows, `$1` uses forward slashes, so Bash reads the path intact.

**`doc-detective.json (fileTypes)`**

```json title="doc-detective.json (fileTypes)"
{
  "fileTypes": [
    {
      "name": "release-notes",
      "extensions": ["txt"],
      "runShell": "node -e \"process.exit(require('fs').readFileSync(process.argv[1], 'utf8').includes('TODO') ? 1 : 0)\" $1"
    }
  ]
}
```

#### Prose

#### Plain text

**`prose.txt`**

```text title="prose.txt"
Release notes for version 2.1

- The search box now matches part of a word.
- Exports keep the column order you set.
```

#### Detected

#### Plain text

**`detected.txt`**

```text title="detected.txt"
Release notes for version 2.1

- The search box now matches part of a word.
- Exports keep the column order you set.
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-filetype-runshell-string",
      "steps": [
        {
          "runShell": {
            "command": "node -e \"process.exit(require('fs').readFileSync(process.argv[1], 'utf8').includes('TODO') ? 1 : 0)\" detected.txt",
            "workingDirectory": "."
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-filetype-runshell-string
    steps:
      - runShell:
          command: "node -e \"process.exit(require('fs').readFileSync(process.argv[1], 'utf8').includes('TODO') ? 1 : 0)\" detected.txt"
          workingDirectory: "."
```

### `runShell` as an object

**Varies:** `fileTypes.runShell` · **Value:** `{ "command": "node -e \"…\" '$1'", "timeout": 10000 }` · **Effect:** takes any `runShell` field, here a `timeout`. Quoting `'$1'` keeps a path with spaces in one argument.

**`doc-detective.json (fileTypes)`**

```json title="doc-detective.json (fileTypes)"
{
  "fileTypes": [
    {
      "name": "release-notes",
      "extensions": ["txt"],
      "runShell": {
        "command": "node -e \"process.exit(require('fs').readFileSync(process.argv[1], 'utf8').includes('TODO') ? 1 : 0)\" '$1'",
        "timeout": 10000
      }
    }
  ]
}
```

#### Prose

#### Plain text

**`prose.txt`**

```text title="prose.txt"
Release notes for version 2.1

- The search box now matches part of a word.
- Exports keep the column order you set.
```

#### Detected

#### Plain text

**`detected.txt`**

```text title="detected.txt"
Release notes for version 2.1

- The search box now matches part of a word.
- Exports keep the column order you set.
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-filetype-runshell-object",
      "steps": [
        {
          "runShell": {
            "command": "node -e \"process.exit(require('fs').readFileSync(process.argv[1], 'utf8').includes('TODO') ? 1 : 0)\" 'detected.txt'",
            "workingDirectory": ".",
            "timeout": 10000
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-filetype-runshell-object
    steps:
      - runShell:
          command: "node -e \"process.exit(require('fs').readFileSync(process.argv[1], 'utf8').includes('TODO') ? 1 : 0)\" 'detected.txt'"
          workingDirectory: "."
          timeout: 10000
```

The standalone variants run the same check on `detected.txt`, with `workingDirectory` set to the folder that holds the spec.

## Replace or add a definition

Both examples extend the built-in formats with one definition that clicks bold text. Only the definition's `name` changes.

### A built-in `name`

**Varies:** `markup.name` · **Value:** `findOnscreenText` · **Effect:** the definition replaces the built-in one of that name, so detection clicks the bold label and doesn't find it.

```json
{
  "name": "findOnscreenText",
  "strong": {},
  "actions": [
    "click"
  ]
}
```

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Click the field

Open the type echo page.

The field is labeled **Type here:**.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Click the field

Open the type echo page.

The field is labeled **Type here:**.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Click the field

Open the type echo page.

The field is labeled *Type here:*.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Click the field</title></head>
<body>
<h1>Click the field</h1>
<p>Open the type echo page.</p>
<p>The field is labeled <strong>Type here:</strong>.</p>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Click the field
===============

Open the type echo page.

The field is labeled **Type here:**.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-markup-replace">
  <title>Click the field</title>
  <body>
    <p>Open the type echo page.</p>
    <p>The field is labeled <b>Type here:</b>.</p>
  </body>
</topic>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"custom-markup-replace","detectSteps":true} -->

# Click the field

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

The field is labeled **Type here:**.

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"custom-markup-replace","detectSteps":true} */}

# Click the field

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

The field is labeled **Type here:**.

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Click the field

// (test {"testId":"custom-markup-replace","detectSteps":true})

Open the type echo page.

// (step {"goTo":"http://localhost:8092/type-echo.html"})

The field is labeled *Type here:*.

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Click the field</title></head>
<body>
<!-- test {"testId":"custom-markup-replace","detectSteps":true} -->
<h1>Click the field</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>The field is labeled <strong>Type here:</strong>.</p>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Click the field
===============

.. test {"testId":"custom-markup-replace","detectSteps":true}

Open the type echo page.

.. step {"goTo":"http://localhost:8092/type-echo.html"}

The field is labeled **Type here:**.

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-markup-replace">
  <title>Click the field</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-markup-replace","detectSteps":true}'/>
    <p>Open the type echo page.</p>
    <data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/>
    <p>The field is labeled <b>Type here:</b>.</p>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"custom-markup-replace","detectSteps":false} -->

# Click the field

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

The field is labeled **Type here:**.

<!-- step {"click":"Type here:"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"custom-markup-replace","detectSteps":false} */}

# Click the field

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

The field is labeled **Type here:**.

{/* step {"click":"Type here:"} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Click the field

// (test {"testId":"custom-markup-replace","detectSteps":false})

Open the type echo page.

// (step {"goTo":"http://localhost:8092/type-echo.html"})

The field is labeled *Type here:*.

// (step {"click":"Type here:"})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Click the field</title></head>
<body>
<!-- test {"testId":"custom-markup-replace","detectSteps":false} -->
<h1>Click the field</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>The field is labeled <strong>Type here:</strong>.</p>
<!-- step {"click":"Type here:"} -->
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Click the field
===============

.. test {"testId":"custom-markup-replace","detectSteps":false}

Open the type echo page.

.. step {"goTo":"http://localhost:8092/type-echo.html"}

The field is labeled **Type here:**.

.. step {"click":"Type here:"}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-markup-replace">
  <title>Click the field</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-markup-replace","detectSteps":false}'/>
    <p>Open the type echo page.</p>
    <data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/>
    <p>The field is labeled <b>Type here:</b>.</p>
    <data name="doc-detective" value='step {"click":"Type here:"}'/>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-markup-replace",
      "steps": [
        {
          "goTo": "http://localhost:8092/type-echo.html"
        },
        {
          "click": "Type here:"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-markup-replace
    steps:
      - goTo: http://localhost:8092/type-echo.html
      - click: "Type here:"
```

### A new `name`

**Varies:** `markup.name` · **Value:** `clickBoldText` · **Effect:** the definition runs beside the built-in ones, so detection clicks the bold label and then finds it.

```json
{
  "name": "clickBoldText",
  "strong": {},
  "actions": [
    "click"
  ]
}
```

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Click the field

Open the type echo page.

The field is labeled **Type here:**.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Click the field

Open the type echo page.

The field is labeled **Type here:**.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Click the field

Open the type echo page.

The field is labeled *Type here:*.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Click the field</title></head>
<body>
<h1>Click the field</h1>
<p>Open the type echo page.</p>
<p>The field is labeled <strong>Type here:</strong>.</p>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Click the field
===============

Open the type echo page.

The field is labeled **Type here:**.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-markup-add">
  <title>Click the field</title>
  <body>
    <p>Open the type echo page.</p>
    <p>The field is labeled <b>Type here:</b>.</p>
  </body>
</topic>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"custom-markup-add","detectSteps":true} -->

# Click the field

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

The field is labeled **Type here:**.

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"custom-markup-add","detectSteps":true} */}

# Click the field

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

The field is labeled **Type here:**.

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Click the field

// (test {"testId":"custom-markup-add","detectSteps":true})

Open the type echo page.

// (step {"goTo":"http://localhost:8092/type-echo.html"})

The field is labeled *Type here:*.

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Click the field</title></head>
<body>
<!-- test {"testId":"custom-markup-add","detectSteps":true} -->
<h1>Click the field</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>The field is labeled <strong>Type here:</strong>.</p>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Click the field
===============

.. test {"testId":"custom-markup-add","detectSteps":true}

Open the type echo page.

.. step {"goTo":"http://localhost:8092/type-echo.html"}

The field is labeled **Type here:**.

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-markup-add">
  <title>Click the field</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-markup-add","detectSteps":true}'/>
    <p>Open the type echo page.</p>
    <data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/>
    <p>The field is labeled <b>Type here:</b>.</p>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"custom-markup-add","detectSteps":false} -->

# Click the field

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

The field is labeled **Type here:**.

<!-- step {"click":"Type here:"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"custom-markup-add","detectSteps":false} */}

# Click the field

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

The field is labeled **Type here:**.

{/* step {"click":"Type here:"} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Click the field

// (test {"testId":"custom-markup-add","detectSteps":false})

Open the type echo page.

// (step {"goTo":"http://localhost:8092/type-echo.html"})

The field is labeled *Type here:*.

// (step {"click":"Type here:"})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Click the field</title></head>
<body>
<!-- test {"testId":"custom-markup-add","detectSteps":false} -->
<h1>Click the field</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>The field is labeled <strong>Type here:</strong>.</p>
<!-- step {"click":"Type here:"} -->
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Click the field
===============

.. test {"testId":"custom-markup-add","detectSteps":false}

Open the type echo page.

.. step {"goTo":"http://localhost:8092/type-echo.html"}

The field is labeled **Type here:**.

.. step {"click":"Type here:"}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-markup-add">
  <title>Click the field</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-markup-add","detectSteps":false}'/>
    <p>Open the type echo page.</p>
    <data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/>
    <p>The field is labeled <b>Type here:</b>.</p>
    <data name="doc-detective" value='step {"click":"Type here:"}'/>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-markup-add",
      "steps": [
        {
          "goTo": "http://localhost:8092/type-echo.html"
        },
        {
          "click": "Type here:"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-markup-add
    steps:
      - goTo: http://localhost:8092/type-echo.html
      - click: "Type here:"
```

## `inlineStatements` permutations

The plain-text examples change the form of the regex statement keys. The others keep the built-in statements for the inline variants and add one `in` container that the detected variants use.

### Regex keys as strings

**Varies:** `inlineStatements.testStart` · **Value:** `(?:^|\\n)TEST (\\{.*\\})` · **Effect:** each key holds one pattern.

```json
{
  "testStart": "(?:^|\\n)TEST (\\{.*\\})",
  "testEnd": "(?:^|\\n)END TEST",
  "step": "(?:^|\\n)STEP (\\{.*\\})"
}
```

#### Prose

#### Plain text

**`prose.txt`**

```text title="prose.txt"
Check the field label

Open the type echo page at http://localhost:8092/type-echo.html.
Check that the page shows Type here:.
```

#### Detected

#### Plain text

**`detected.txt`**

```text title="detected.txt"
Check the field label

TEST {"testId":"custom-statements-string","detectSteps":true}

Open the type echo page at http://localhost:8092/type-echo.html.
STEP {"goTo":"http://localhost:8092/type-echo.html"}
Check that the page shows Type here:.

END TEST
```

#### Inline

#### Plain text

**`inline.txt`**

```text title="inline.txt"
Check the field label

TEST {"testId":"custom-statements-string","detectSteps":false}

Open the type echo page at http://localhost:8092/type-echo.html.
STEP {"goTo":"http://localhost:8092/type-echo.html"}
Check that the page shows Type here:.
STEP {"find":"Type here:"}

END TEST
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-statements-string",
      "steps": [
        {
          "goTo": "http://localhost:8092/type-echo.html"
        },
        {
          "find": "Type here:"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-statements-string
    steps:
      - goTo: http://localhost:8092/type-echo.html
      - find: "Type here:"
```

### Regex keys as arrays

**Varies:** `inlineStatements.testStart` · **Value:** `["…TEST…", "…Test…"]` · **Effect:** each key holds several patterns, so `TEST` and `Test` both start a test. The detected and inline variants use the `Test`, `Step`, and `End test` forms.

```json
{
  "testStart": [
    "(?:^|\\n)TEST (\\{.*\\})",
    "(?:^|\\n)Test (\\{.*\\})"
  ],
  "testEnd": [
    "(?:^|\\n)END TEST",
    "(?:^|\\n)End test"
  ],
  "step": [
    "(?:^|\\n)STEP (\\{.*\\})",
    "(?:^|\\n)Step (\\{.*\\})"
  ]
}
```

#### Prose

#### Plain text

**`prose.txt`**

```text title="prose.txt"
Check the field label

Open the type echo page at http://localhost:8092/type-echo.html.
Check that the page shows Type here:.
```

#### Detected

#### Plain text

**`detected.txt`**

```text title="detected.txt"
Check the field label

Test {"testId":"custom-statements-array","detectSteps":true}

Open the type echo page at http://localhost:8092/type-echo.html.
Step {"goTo":"http://localhost:8092/type-echo.html"}
Check that the page shows Type here:.

End test
```

#### Inline

#### Plain text

**`inline.txt`**

```text title="inline.txt"
Check the field label

Test {"testId":"custom-statements-array","detectSteps":false}

Open the type echo page at http://localhost:8092/type-echo.html.
Step {"goTo":"http://localhost:8092/type-echo.html"}
Check that the page shows Type here:.
Step {"find":"Type here:"}

End test
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-statements-array",
      "steps": [
        {
          "goTo": "http://localhost:8092/type-echo.html"
        },
        {
          "find": "Type here:"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-statements-array
    steps:
      - goTo: http://localhost:8092/type-echo.html
      - find: "Type here:"
```

### An `in` code block

**Varies:** `inlineStatements.in[].codeBlock` · **Value:** `"dd"` · **Effect:** a code block whose language is `dd` holds a statement.

```json
{
  "codeBlock": "dd"
}
```

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Check the field label

Open the type echo page.

The field is labeled Type here:.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Check the field label

Open the type echo page.

The field is labeled Type here:.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Check the field label

Open the type echo page.

The field is labeled Type here:.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the field label</title></head>
<body>
<h1>Check the field label</h1>
<p>Open the type echo page.</p>
<p>The field is labeled Type here:.</p>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Check the field label
=====================

Open the type echo page.

The field is labeled Type here:.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-statements-in-codeblock">
  <title>Check the field label</title>
  <body>
    <p>Open the type echo page.</p>
    <p>The field is labeled Type here:.</p>
  </body>
</topic>
```

#### Detected

#### Markdown

**`detected.md`**

````markdown title="detected.md"
<!-- test {"testId":"custom-statements-in-codeblock","detectSteps":true} -->

# Check the field label

Open the type echo page.

```dd
step {"goTo":"http://localhost:8092/type-echo.html"}
```

The field is labeled Type here:.

```dd
step {"find":"Type here:"}
```

<!-- test end -->
````

#### MDX

**`detected.mdx`**

````mdx title="detected.mdx"
{/* test {"testId":"custom-statements-in-codeblock","detectSteps":true} */}

# Check the field label

Open the type echo page.

```dd
step {"goTo":"http://localhost:8092/type-echo.html"}
```

The field is labeled Type here:.

```dd
step {"find":"Type here:"}
```

{/* test end */}
````

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Check the field label

// (test {"testId":"custom-statements-in-codeblock","detectSteps":true})

Open the type echo page.

[source,dd]
----
step {"goTo":"http://localhost:8092/type-echo.html"}
----

The field is labeled Type here:.

[source,dd]
----
step {"find":"Type here:"}
----

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the field label</title></head>
<body>
<!-- test {"testId":"custom-statements-in-codeblock","detectSteps":true} -->
<h1>Check the field label</h1>
<p>Open the type echo page.</p>
<pre><code class="language-dd">step {"goTo":"http://localhost:8092/type-echo.html"}</code></pre>
<p>The field is labeled Type here:.</p>
<pre><code class="language-dd">step {"find":"Type here:"}</code></pre>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Check the field label
=====================

.. test {"testId":"custom-statements-in-codeblock","detectSteps":true}

Open the type echo page.

.. code-block:: dd

   step {"goTo":"http://localhost:8092/type-echo.html"}

The field is labeled Type here:.

.. code-block:: dd

   step {"find":"Type here:"}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-statements-in-codeblock">
  <title>Check the field label</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-statements-in-codeblock","detectSteps":true}'/>
    <p>Open the type echo page.</p>
    <codeblock outputclass="language-dd">step {"goTo":"http://localhost:8092/type-echo.html"}</codeblock>
    <p>The field is labeled Type here:.</p>
    <codeblock outputclass="language-dd">step {"find":"Type here:"}</codeblock>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"custom-statements-in-codeblock","detectSteps":false} -->

# Check the field label

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

The field is labeled Type here:.

<!-- step {"find":"Type here:"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"custom-statements-in-codeblock","detectSteps":false} */}

# Check the field label

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

The field is labeled Type here:.

{/* step {"find":"Type here:"} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Check the field label

// (test {"testId":"custom-statements-in-codeblock","detectSteps":false})

Open the type echo page.

// (step {"goTo":"http://localhost:8092/type-echo.html"})

The field is labeled Type here:.

// (step {"find":"Type here:"})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the field label</title></head>
<body>
<!-- test {"testId":"custom-statements-in-codeblock","detectSteps":false} -->
<h1>Check the field label</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>The field is labeled Type here:.</p>
<!-- step {"find":"Type here:"} -->
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Check the field label
=====================

.. test {"testId":"custom-statements-in-codeblock","detectSteps":false}

Open the type echo page.

.. step {"goTo":"http://localhost:8092/type-echo.html"}

The field is labeled Type here:.

.. step {"find":"Type here:"}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-statements-in-codeblock">
  <title>Check the field label</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-statements-in-codeblock","detectSteps":false}'/>
    <p>Open the type echo page.</p>
    <data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/>
    <p>The field is labeled Type here:.</p>
    <data name="doc-detective" value='step {"find":"Type here:"}'/>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-statements-in-codeblock",
      "steps": [
        {
          "goTo": "http://localhost:8092/type-echo.html"
        },
        {
          "find": "Type here:"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-statements-in-codeblock
    steps:
      - goTo: http://localhost:8092/type-echo.html
      - find: "Type here:"
```

### An `in` comment with `regex`

**Varies:** `inlineStatements.in[].regex` · **Value:** `^\\s*dd:\\s*([\\s\\S]*)$` · **Effect:** a comment that starts with `dd:` holds a statement, and `regex` keeps the text after the prefix.

```json
{
  "comment": {},
  "regex": "^\\s*dd:\\s*([\\s\\S]*)$"
}
```

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Check the field label

Open the type echo page.

The field is labeled Type here:.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Check the field label

Open the type echo page.

The field is labeled Type here:.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Check the field label

Open the type echo page.

The field is labeled Type here:.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the field label</title></head>
<body>
<h1>Check the field label</h1>
<p>Open the type echo page.</p>
<p>The field is labeled Type here:.</p>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Check the field label
=====================

Open the type echo page.

The field is labeled Type here:.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-statements-in-comment">
  <title>Check the field label</title>
  <body>
    <p>Open the type echo page.</p>
    <p>The field is labeled Type here:.</p>
  </body>
</topic>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"custom-statements-in-comment","detectSteps":true} -->

# Check the field label

Open the type echo page.

<!-- dd: step {"goTo":"http://localhost:8092/type-echo.html"} -->

The field is labeled Type here:.

<!-- dd: step {"find":"Type here:"} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"custom-statements-in-comment","detectSteps":true} */}

# Check the field label

Open the type echo page.

{/* dd: step {"goTo":"http://localhost:8092/type-echo.html"} */}

The field is labeled Type here:.

{/* dd: step {"find":"Type here:"} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Check the field label

// (test {"testId":"custom-statements-in-comment","detectSteps":true})

Open the type echo page.

// dd: step {"goTo":"http://localhost:8092/type-echo.html"}

The field is labeled Type here:.

// dd: step {"find":"Type here:"}

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the field label</title></head>
<body>
<!-- test {"testId":"custom-statements-in-comment","detectSteps":true} -->
<h1>Check the field label</h1>
<p>Open the type echo page.</p>
<!-- dd: step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>The field is labeled Type here:.</p>
<!-- dd: step {"find":"Type here:"} -->
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Check the field label
=====================

.. test {"testId":"custom-statements-in-comment","detectSteps":true}

Open the type echo page.

.. dd: step {"goTo":"http://localhost:8092/type-echo.html"}

The field is labeled Type here:.

.. dd: step {"find":"Type here:"}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-statements-in-comment">
  <title>Check the field label</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-statements-in-comment","detectSteps":true}'/>
    <p>Open the type echo page.</p>
    <!-- dd: step {"goTo":"http://localhost:8092/type-echo.html"} -->
    <p>The field is labeled Type here:.</p>
    <!-- dd: step {"find":"Type here:"} -->
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"custom-statements-in-comment","detectSteps":false} -->

# Check the field label

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

The field is labeled Type here:.

<!-- step {"find":"Type here:"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"custom-statements-in-comment","detectSteps":false} */}

# Check the field label

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

The field is labeled Type here:.

{/* step {"find":"Type here:"} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Check the field label

// (test {"testId":"custom-statements-in-comment","detectSteps":false})

Open the type echo page.

// (step {"goTo":"http://localhost:8092/type-echo.html"})

The field is labeled Type here:.

// (step {"find":"Type here:"})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the field label</title></head>
<body>
<!-- test {"testId":"custom-statements-in-comment","detectSteps":false} -->
<h1>Check the field label</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>The field is labeled Type here:.</p>
<!-- step {"find":"Type here:"} -->
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Check the field label
=====================

.. test {"testId":"custom-statements-in-comment","detectSteps":false}

Open the type echo page.

.. step {"goTo":"http://localhost:8092/type-echo.html"}

The field is labeled Type here:.

.. step {"find":"Type here:"}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="custom-statements-in-comment">
  <title>Check the field label</title>
  <body>
    <data name="doc-detective" value='test {"testId":"custom-statements-in-comment","detectSteps":false}'/>
    <p>Open the type echo page.</p>
    <data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/>
    <p>The field is labeled Type here:.</p>
    <data name="doc-detective" value='step {"find":"Type here:"}'/>
    <data name="doc-detective" value='test end'/>
  </body>
</topic>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-statements-in-comment",
      "steps": [
        {
          "goTo": "http://localhost:8092/type-echo.html"
        },
        {
          "find": "Type here:"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-statements-in-comment
    steps:
      - goTo: http://localhost:8092/type-echo.html
      - find: "Type here:"
```

### An `in` element with `value`

**Varies:** `inlineStatements.in[].value` · **Value:** `attributes.data-dd` · **Effect:** an empty `<span>` holds its statement in the `data-dd` attribute.

```json
{
  "element": {
    "tag": [
      "span"
    ],
    "attributes": {
      "data-dd": true
    }
  },
  "value": "attributes.data-dd"
}
```

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Check the field label

Open the type echo page.

The field is labeled Type here:.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Check the field label

Open the type echo page.

The field is labeled Type here:.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the field label</title></head>
<body>
<h1>Check the field label</h1>
<p>Open the type echo page.</p>
<p>The field is labeled Type here:.</p>
</body>
</html>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"custom-statements-in-value","detectSteps":true} -->

# Check the field label

Open the type echo page.

<span data-dd='step {"goTo":"http://localhost:8092/type-echo.html"}'></span>

The field is labeled Type here:.

<span data-dd='step {"find":"Type here:"}'></span>

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"custom-statements-in-value","detectSteps":true} */}

# Check the field label

Open the type echo page.

<span data-dd='step {"goTo":"http://localhost:8092/type-echo.html"}'></span>

The field is labeled Type here:.

<span data-dd='step {"find":"Type here:"}'></span>

{/* test end */}
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the field label</title></head>
<body>
<!-- test {"testId":"custom-statements-in-value","detectSteps":true} -->
<h1>Check the field label</h1>
<p>Open the type echo page.</p>
<span data-dd='step {"goTo":"http://localhost:8092/type-echo.html"}'></span>
<p>The field is labeled Type here:.</p>
<span data-dd='step {"find":"Type here:"}'></span>
<!-- test end -->
</body>
</html>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"custom-statements-in-value","detectSteps":false} -->

# Check the field label

Open the type echo page.

<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->

The field is labeled Type here:.

<!-- step {"find":"Type here:"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"custom-statements-in-value","detectSteps":false} */}

# Check the field label

Open the type echo page.

{/* step {"goTo":"http://localhost:8092/type-echo.html"} */}

The field is labeled Type here:.

{/* step {"find":"Type here:"} */}

{/* test end */}
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check the field label</title></head>
<body>
<!-- test {"testId":"custom-statements-in-value","detectSteps":false} -->
<h1>Check the field label</h1>
<p>Open the type echo page.</p>
<!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
<p>The field is labeled Type here:.</p>
<!-- step {"find":"Type here:"} -->
<!-- test end -->
</body>
</html>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-statements-in-value",
      "steps": [
        {
          "goTo": "http://localhost:8092/type-echo.html"
        },
        {
          "find": "Type here:"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-statements-in-value
    steps:
      - goTo: http://localhost:8092/type-echo.html
      - find: "Type here:"
```

This example shows Markdown, MDX, and HTML. DITA's built-in statements already use this form, with `<data>` and `value`.

## `includeStatements` permutations

Each example includes a shared file whose line detection turns into a `find`. Includes need `resolveIncludes`, which is on by default.

### One pattern

**Varies:** `fileTypes.includeStatements` · **Value:** `^INCLUDE (\\S+)$` · **Effect:** an `INCLUDE` line pulls in `check-label.txt`.

```json
{
  "includeStatements": "^INCLUDE (\\S+)$"
}
```

#### Prose

#### Plain text

**`prose.txt`**

```text title="prose.txt"
Check the field label

Open the type echo page at http://localhost:8092/type-echo.html.
INCLUDE check-label.txt
```

#### Detected

#### Plain text

**`detected.txt`**

```text title="detected.txt"
Check the field label

TEST {"testId":"custom-include-string","detectSteps":true}

Open the type echo page at http://localhost:8092/type-echo.html.
STEP {"goTo":"http://localhost:8092/type-echo.html"}
INCLUDE check-label.txt

END TEST
```

#### Inline

#### Plain text

**`inline.txt`**

```text title="inline.txt"
Check the field label

TEST {"testId":"custom-include-string","detectSteps":false}

Open the type echo page at http://localhost:8092/type-echo.html.
STEP {"goTo":"http://localhost:8092/type-echo.html"}
INCLUDE check-label.txt
STEP {"find":"Type here:"}

END TEST
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-include-string",
      "steps": [
        {
          "goTo": "http://localhost:8092/type-echo.html"
        },
        {
          "find": "Type here:"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-include-string
    steps:
      - goTo: http://localhost:8092/type-echo.html
      - find: "Type here:"
```

### Several patterns

**Varies:** `fileTypes.includeStatements` · **Value:** `["^INCLUDE (\\S+)$", …]` · **Effect:** an `INCLUDE` line and a `#include` line each pull in a file.

```json
{
  "includeStatements": [
    "^INCLUDE (\\S+)$",
    "^#include \"([^\"]+)\"$"
  ]
}
```

#### Prose

#### Plain text

**`prose.txt`**

```text title="prose.txt"
Check the field label

Open the type echo page at http://localhost:8092/type-echo.html.
INCLUDE check-label.txt
Then check the heading.
#include "check-heading.txt"
```

#### Detected

#### Plain text

**`detected.txt`**

```text title="detected.txt"
Check the field label

TEST {"testId":"custom-include-array","detectSteps":true}

Open the type echo page at http://localhost:8092/type-echo.html.
STEP {"goTo":"http://localhost:8092/type-echo.html"}
INCLUDE check-label.txt
Then check the heading.
#include "check-heading.txt"

END TEST
```

#### Inline

#### Plain text

**`inline.txt`**

```text title="inline.txt"
Check the field label

TEST {"testId":"custom-include-array","detectSteps":false}

Open the type echo page at http://localhost:8092/type-echo.html.
STEP {"goTo":"http://localhost:8092/type-echo.html"}
INCLUDE check-label.txt
STEP {"find":"Type here:"}
Then check the heading.
#include "check-heading.txt"
STEP {"find":"Type Echo Test Page"}

END TEST
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "custom-include-array",
      "steps": [
        {
          "goTo": "http://localhost:8092/type-echo.html"
        },
        {
          "find": "Type here:"
        },
        {
          "find": "Type Echo Test Page"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: custom-include-array
    steps:
      - goTo: http://localhost:8092/type-echo.html
      - find: "Type here:"
      - find: Type Echo Test Page
```