Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wraped lines and textarea / pre #15

Open
marcimat opened this issue May 7, 2021 · 1 comment
Open

Wraped lines and textarea / pre #15

marcimat opened this issue May 7, 2021 · 1 comment

Comments

@marcimat
Copy link

marcimat commented May 7, 2021

Hello and thanks for this prism-live library !

I'd like to try prism-live to write some long text like articles in markdown or things like that, and so I want long lines to wrap.

It's almost working with some little corrections.

Force wrapping lines in the wanted language (sorry for ugly css — it's an example) :

.language-xxx {
    white-space: pre-wrap !important;
}

But. textarea and pre don't have the same padding-right, so sometimes a word comes in next line in the colored text, and not in the textarea. In fact a padding-right with --scrollbar-width is applied on the pre and not on the textarea.

One possible correction is to use the same padding (almost for right) as the pre. Like (again ugly) :

.prism-live textarea.prism-live,
.prism-live pre.prism-live
{
    --scrollbar-width: 17px;
    padding: 1em !important;
    padding-bottom: var(--scrollbar-width) !important;
    padding-right: var(--scrollbar-width) !important;
}

This corrects the most common problems I've seen.
Although we need to use a coloration that don't change the size or weight of the font.

@rastapopougros
Copy link

Although we need to use a coloration that don't change the size or weight of the font.

Precision on this point:

  • it's not so frequent to change size, but very frequent in lightweight syntax like MD, and… Prism provide MD, no just coding languages :)
  • even for just coding languages, it's frequent to use bold, italic, etc, for some important keywords, but for now, even bold text de-synchronize the pre and the textarea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants