diff --git a/doc/api/async_hooks.md b/doc/api/async_hooks.md index 9e30f3481aa195..83efca6a5c5974 100644 --- a/doc/api/async_hooks.md +++ b/doc/api/async_hooks.md @@ -25,9 +25,7 @@ as the abstract concept that is a resource. If [`Worker`][]s are used, each thread has an independent `async_hooks` interface, and each thread will use a new set of async IDs. -## Public API - -### Overview +## Overview Following is a simple overview of the public API. @@ -79,7 +77,7 @@ function destroy(asyncId) { } function promiseResolve(asyncId) { } ``` -#### `async_hooks.createHook(callbacks)` +## `async_hooks.createHook(callbacks)` ' + '
Describe Something
in more detail here.
Please see the' +
'Command Line Optionsdocument for more information. An example of a' +
+ '# An example of a' +
'webserverwritten with Node.js which responds with Check' +
+ ' Check' +
'out alsothis guidenode \\[options\\] index.js' +
+ '
Usage#
node \\[options\\] index.js' +
'
' +
+ '
' +
'Example' +
- '#
' +
'\'Hello, World!\'
:See also#
See also#
.
+ if (content.includes('
')) {
+ throw new Error('Cannot increment a level 6 header');
+ }
+ // `++level` to convert the string to a number and increment it.
+ content = content.replace(/(?<=<\/?h)[1-5](?=[^<>]*>)/g, (level) => ++level);
+ // Wrap h3 tags in section tags.
let firstTime = true;
- return content.toString()
- .replace(/
{
+ return content
+ .replace(/
{
if (firstTime) {
firstTime = false;
return '