Skip to content

Commit 643bed2

Browse files
wilkinsonaphilwebb
authored andcommitted
Format code
1 parent bfc6ead commit 643bed2

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

lib/include-code-extension.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ function createExtensionGroup (context) {
3030
if (!langs.length) return log(doc, 'warn', `no search locations defined for include-code::${target}[]`)
3131
const cursor = doc.getReader().$cursor_at_mark()
3232
tabsEnabled ??= doc.getExtensions().hasBlocks() && !!doc.getExtensions().getBlockFor('tabs', 'example')
33-
const attrsStr = Object.entries(attrs).filter(([n, v]) => n !== 'title').reduce((buf, [n, v]) => `${buf}${buf ? ',' : ''}${n}=${v}`, '')
33+
const attrsStr = Object.entries(attrs)
34+
.filter(([n, v]) => n !== 'title')
35+
.reduce((buf, [n, v]) => `${buf}${buf ? ',' : ''}${n}=${v}`, '')
3436
const sectionId = (nearest(parent, 'section') || doc).getId()
3537
const relativeIdPath = sectionId
3638
? sectionId.replaceAll('-', '').replaceAll('.', '/') + '/' + sanitizedTarget

test/include-code-extension-test.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,12 @@ describe('include-code-extension', () => {
507507
const codeBlocks = tabs.findBy({ context: 'listing' })
508508
expect(codeBlocks).to.have.lengthOf(4)
509509
const actualProperties = codeBlocks.map((block) => {
510-
return { style: block.getStyle(), language: block.getAttributes().language, title: block.getTitle(), someAttribute: block.getAttribute('some-attribute') }
510+
return {
511+
style: block.getStyle(),
512+
language: block.getAttributes().language,
513+
title: block.getTitle(),
514+
someAttribute: block.getAttribute('some-attribute'),
515+
}
511516
})
512517
console.log(actualProperties)
513518
expect(actualProperties).to.eql(expected)

0 commit comments

Comments
 (0)