From 46c03bd866c6fcd152762982ef3d0dc9c2b8e711 Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Wed, 10 Jul 2019 21:19:58 +0100 Subject: [PATCH] build(docs-infra): never show linenums for triple-backticked code blocks (#31493) PR Close #31493 --- aio/tools/transforms/remark-package/services/handlers/code.js | 4 +++- .../transforms/remark-package/services/renderMarkdown.spec.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/aio/tools/transforms/remark-package/services/handlers/code.js b/aio/tools/transforms/remark-package/services/handlers/code.js index a208704e93..d4a07e442a 100644 --- a/aio/tools/transforms/remark-package/services/handlers/code.js +++ b/aio/tools/transforms/remark-package/services/handlers/code.js @@ -4,7 +4,9 @@ module.exports = function code(h, node) { var value = node.value ? ('\n' + node.value + '\n') : ''; var lang = node.lang && node.lang.match(/^[^ \t]+(?=[ \t]|$)/); - var props = {}; + var props = { + linenums: 'false' + }; if (lang) { props.language = lang; diff --git a/aio/tools/transforms/remark-package/services/renderMarkdown.spec.js b/aio/tools/transforms/remark-package/services/renderMarkdown.spec.js index 973a9c8008..12e41dbe5d 100644 --- a/aio/tools/transforms/remark-package/services/renderMarkdown.spec.js +++ b/aio/tools/transforms/remark-package/services/renderMarkdown.spec.js @@ -88,7 +88,7 @@ describe('remark: renderMarkdown service', () => { '```'; const output = renderMarkdown(content); expect(output).toEqual( - '\n' + + '\n' + ' class MyClass {\n' + ' method1() { ... }\n' + ' }\n' +