chore: fix api.json (#15093)

This commit is contained in:
Pavel Feldman 2022-06-23 16:15:14 -07:00 committed by GitHub
parent 6fab9d4044
commit d60f84d06a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -15,7 +15,7 @@ echo "Building playwright-core package"
node ../../utils/pack_package.js playwright-core ./output/playwright-core.tgz
echo "Building api.json and protocol.yml"
node ../../utils/doclint/generateApiJson.js > ./output/api.json
API_JSON_MODE=1 node ../../utils/doclint/generateApiJson.js > ./output/api.json
cp ../../packages/playwright-core/src/protocol/protocol.yml ./output/
function build {

View file

@ -264,7 +264,10 @@ function innerRenderMdNode(indent, node, lastNode, result, maxColumns) {
if (node.type === 'code') {
newLine();
result.push(`${indent}\`\`\`${codeLangToHighlighter(node.codeLang)}`);
if (process.env.API_JSON_MODE)
result.push(`${indent}\`\`\`${node.codeLang}`);
else
result.push(`${indent}\`\`\`${codeLangToHighlighter(node.codeLang)}`);
for (const line of node.lines)
result.push(indent + line);
result.push(`${indent}\`\`\``);