expressive-code / expressive-code

A text marking & annotation engine for presenting source code on the web.

Home Page:https://expressive-code.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature: Option to wrap text?

oofdere opened this issue · comments

Problem

When copying output from a terminal, for instance, the text will copy unwrapped. even though it is wrapped in the terminal:

image

image

Solution

There should be an option to wrap text. Maybe something like

```bash wrap="true"
text goes here
```

Thank you for this feature request!

I agree, there should be a wrap option. I'll add it!

@hippotastic Hey I was just checking to see if this feature was ever implented. Specifically for the <Code /> component version, and ideally if there's a way to set this globally rather than per-instance.

What a coincidence, I'm actually working on this right now!

image

There is going to be a release in the next couple of days that includes line numbers, word wrapping and custom gutter icon support. Everything is going to be configurable as always. :)

Oh awesome, this will be super valuable. Thank you so much! I'll keep an eye out for this release.

This feature is now available in the new 0.33 minor release. You can find the docs here: https://expressive-code.com/key-features/word-wrap/

It's configurable both globally in the EC config, and per block using the meta string or per Code component using props.

This will also be available in Starlight once my PR to update to my latest release got merged. This is planned for Friday. Hope that helps! :)

Thank you @hippotastic! This is a great a11y improvement! Very excited to implement!