Pretty format (#20352)
* Update prettier flow to include JS * Run prettier * ...run prettier
This commit is contained in:
@@ -70,7 +70,7 @@ const LANGUAGE_MAP = {
|
||||
|
||||
// Unofficial languages
|
||||
shellsession: 'Shell',
|
||||
jsx: 'JSX'
|
||||
jsx: 'JSX',
|
||||
}
|
||||
|
||||
const COPY_REGEX = /\{:copy\}$/
|
||||
@@ -78,7 +78,7 @@ const COPY_REGEX = /\{:copy\}$/
|
||||
/**
|
||||
* Adds a bar above code blocks that shows the language and a copy button
|
||||
*/
|
||||
export default function addCodeHeader (node) {
|
||||
export default function addCodeHeader(node) {
|
||||
// Check if the language matches `lang{:copy}`
|
||||
const hasCopy = node.lang && COPY_REGEX.test(node.lang)
|
||||
|
||||
@@ -109,30 +109,24 @@ export default function addCodeHeader (node) {
|
||||
'p-2',
|
||||
'text-small',
|
||||
'rounded-top-1',
|
||||
'border'
|
||||
]
|
||||
'border',
|
||||
],
|
||||
},
|
||||
[
|
||||
h('span', language),
|
||||
h(
|
||||
'button',
|
||||
{
|
||||
class: [
|
||||
'js-btn-copy',
|
||||
'btn',
|
||||
'btn-sm',
|
||||
'tooltipped',
|
||||
'tooltipped-nw'
|
||||
],
|
||||
class: ['js-btn-copy', 'btn', 'btn-sm', 'tooltipped', 'tooltipped-nw'],
|
||||
'data-clipboard-text': node.value,
|
||||
'aria-label': 'Copy code to clipboard'
|
||||
'aria-label': 'Copy code to clipboard',
|
||||
},
|
||||
btnIcon
|
||||
)
|
||||
),
|
||||
]
|
||||
)
|
||||
|
||||
return {
|
||||
before: [header]
|
||||
before: [header],
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user