carbon icon indicating copy to clipboard operation
carbon copied to clipboard

Screenshot formatting is broken for hanging indent code

Open aidansunbury opened this issue 1 year ago • 2 comments

Describe the bug When writing code with hanging indents (first line is at the margin, subsequent lines are indented), the screenshot exports are not formatted in the same way as they appear in the carbon editor.

This may also just be an issue with the editor frame not wrapping code when it should. Making the editor frame slightly wider normally fixes the issue.

To Reproduce Write any code in the editor using hanging indents and export it. I tested that both the copy to clipboard and the download image exports were broken.

Screenshots Screenshot 2023-09-20 at 2 25 50 PM

View in Editor

image

Exported image

  • OS [e.g. macOS]: macOS
  • Browser [e.g. Chrome]: Chrome
  • Carbon URL [e.g. carbon.now.sh?bg=pink]: https://carbon.now.sh/7sZ1Ptl7aSU6F3jciLjV (example code that will not export properly

aidansunbury avatar Sep 20 '23 21:09 aidansunbury

I would like to work on this. If possible please assign me.

zach28attack avatar Oct 09 '23 16:10 zach28attack

I can repro, e.g.:

import { expect, test } from '@nuxt/test-utils/playwright'

test.use({
  nuxt: {
    rootDir: fileURLToPath(new URL('..', import.meta.url))
  }
})

test('test', async ({ page, goto }) => {
  await goto('/', { waitUntil: 'hydration' })
  await expect(page.getByRole('heading')).toHaveText('Welcome to Playwright!')
})

produces:

carbon (3)

mxschmitt avatar Mar 19 '24 13:03 mxschmitt