Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[Help] Formatting/styling for a Textarea input

November 10 (6 years ago)

Edited November 10 (6 years ago)
Leothedino
Sheet Author

Hey guys,

I've recently published a Witcher sheet (with the amazing help and assistance from some of you guys on this forum, thank you), but I discovered a weird issue in the text areas. A lot of players have, and will, copy & paste spells and skills descriptions straight out of the rulebook and into the sheet. This is fine, and works, but the formatting is terrible. It all bunches to the side of the box, in the style from the rulebook/PDF. Is there anyway I can treat the code, or CSS, of the textarea itself to strip it of this effect and force it to use all of the space provided?

EXAMPLES:

CURRENTLY: This is how it looks. C&Ping into the box bunches it all up.

HOW I WANT IT: To get this effect, each line on the left must be 'backspaced', but this is how I would want it to look.


November 10 (6 years ago)
Finderski
Pro
Sheet Author
Compendium Curator

The only way I've found is to paste it in a plain text editor, preferably one that can do find/replace on things like line breaks, then replace those line breaks with a space, then copy/paste it into the character sheet. It gets a little tricky if you're copying multiple paragraphs, but...

November 10 (6 years ago)
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator

Yep, this isn't a sheet issue, this is an issue with how most game PDFs are laid out. They use hard line breaks to wrap around art or create columns. You could change the whitespace handling of the textareas, but it's not advisable because then your textareas won't be able to accept any line breaks.

Hmm. I suppose a sheet workers could be written that would accommodate most things, but it'd cause it's own problems for things like (un)ordered lists and other places that are supposed to have a line break, but not actually be the end of a sentence.

November 10 (6 years ago)
Leothedino
Sheet Author

Yeah, so far that is my only remedy too. I plan to breeze through my players sheets, and edit them myself, but still annoying I can't seem to find a way to 'remove formatting' on input. I have a sneaky suspicion you could do it with JS, but we can't access that, can we :(

November 10 (6 years ago)
Jakob
Sheet Author
API Scripter

Leothedino said:

Yeah, so far that is my only remedy too. I plan to breeze through my players sheets, and edit them myself, but still annoying I can't seem to find a way to 'remove formatting' on input. I have a sneaky suspicion you could do it with JS, but we can't access that, can we :(

You can kind of do it with sheet workers, at a cost. It wouldn't be hard to write a sheet worker which removes all line breaks in a text field, or replaces them with a space. Of course, the downside is that you cannot put line breaks into those fields anymore. As such, I wouldn't do it for a public sheet, because it's very confusing behaviour to the user. For a custom sheet in your game, that might be fine.

November 10 (6 years ago)
Leothedino
Sheet Author

Solid advice. Well, I am sure everybody is in the same boat on this, all sheet users public and custom. Thanks for the hasty replies and answers.