diff --git a/src/codeql-cli/scripts/convert-markdown-for-docs.js b/src/codeql-cli/scripts/convert-markdown-for-docs.js index 4a5272065a..51783a253f 100644 --- a/src/codeql-cli/scripts/convert-markdown-for-docs.js +++ b/src/codeql-cli/scripts/convert-markdown-for-docs.js @@ -8,6 +8,7 @@ import { visit, SKIP } from 'unist-util-visit' import { remove } from 'unist-util-remove' import { languageKeys } from '../../../lib/languages.js' +import { MARKDOWN_OPTIONS } from '../../content-linter/lib/helpers/unified-formatter-options.js' const { targetDirectory, removeKeywords } = JSON.parse( await readFile(path.join('src/codeql-cli/lib/config.json'), 'utf-8'), @@ -217,7 +218,7 @@ export async function convertContentToDocs(content, frontmatterDefaults = {}) { // remove the first heading from the AST because that becomes frontmatter remove(ast, (node) => node.type === 'heading' && node.depth === 1) - return { content: toMarkdown(ast), data: frontmatter } + return { content: toMarkdown(ast, MARKDOWN_OPTIONS), data: frontmatter } } // performs a get request for a aka.ms url and returns the redirect url diff --git a/src/content-linter/lib/helpers/unified-formatter-options.js b/src/content-linter/lib/helpers/unified-formatter-options.js new file mode 100644 index 0000000000..ecbd2d60b3 --- /dev/null +++ b/src/content-linter/lib/helpers/unified-formatter-options.js @@ -0,0 +1,9 @@ +export const MARKDOWN_OPTIONS = { + bullet: '-', + emphasis: '_', + closeAtx: false, + fence: '`', + fences: true, + incrementListMarker: false, + strong: '*', +}