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

Formatting text in an attribute?

Is it possible to format text in an attribute: bold / italic / underlined /bullets/etc.? I have a repeating section roughtly like so: <fieldset class="reapeating_X"> <div> <span name="attr_title"></span><br /> <span name="attr_description"></span>   </div> </fieldset> The descriptions may sometimes have emphasized elements in their text. It would be real nice to be able to make such parts bold somehow. But it seems placed <b> tags are just ignored. Is there some other clever way to do it, some sort of supported markdown(?), or is it simply not supported at all?
1648492345
vÍnce
Pro
Sheet Author
Apologies... there isn't any text in your example, so I'm not exactly sure what you exactly want to style? Just about anything you wrap in an element can be styled either by assigning a css class or inline(not preferred). html <span class="titles" name="attr_title"></span> css .charsheet .titles {     font-size: 14px;     font-weight: bold;     color: #222 } inline <span style="font-size:14px; font-weight:bold; color:#222;" name="attr_title"></span> You can also style text within a field (input) as well if that's desired. Cheers
1648508040

Edited 1648508082
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
I think what you're looking for is being able to stylize individual words in an attribute. e.g. The quick   brown   fox  jumped over the fence. Unfortunately, that is not possible.
1648511280
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Markdown will work if the contents of the attribute are sent to chat, but not as displayed on the sheet.
Scott C. said: I think what you're looking for is being able to stylize individual words in an attribute. e.g. The quick   brown   fox  jumped over the fence. Unfortunately, that is not possible. Exactly, that was the kind of thing I was hoping to do.
1648564393

Edited 1648565193
Oosh
Sheet Author
API Scripter
If it was super important to a sheet, you'd be able to get it to happen, in a 'kind of' way. I doubt it's worth the effort, but FWIW, I think this would work. 1. Create a toggle, much like a normal drop-down to add in information, but with a minor difference: it switches between input mode and display mode. Either the textarea where you input the description attribute is visible, or the display version is. 2. The description input area is standard 3. The display area is split into more attributes, with cycling styles for the effects you want. You may need alot of these: edit - can't remember if you can use a span as an attribute display or not. If not, pick a tag that works and restyle it so it acts like an inline span < fieldset class = "repeating_X" >   < div >     < span name = "attr_title" ></ span >< br />   </ div >   < button > <!-- Button toggles the hidden input below --> </ button >   < input type = "hidden" name = "attr_toggle-display" value = "0" />   < div class = "description-input" > <!-- Displays when toggle-display value === 1 -->     < textarea name = "attr_description" ></ textarea >   </ div >   < div class = "description-display" > <!-- Displays when toggle-display value === 0 -->     < span class = "normal" name = "attr_desc1" ></ span >     < span class = "bold" name = "attr_desc2" ></ span >     < span class = "italic" name = "attr_desc3" ></ span >     < span class = "normal" name = "attr_desc4" ></ span >     < span class = "bold" name = "attr_desc5" ></ span >     < span class = "italic" name = "attr_desc6" ></ span >     <!-- As many of these as you need....     ...     ...     ...-->   </ div > </ fieldset > Finally, you have a sheetworker with an on(change) event for the description attribute. Using an example of standard markdown, like: This is a *description* of an *item*  ==> This is a description of an item You'd need your sheetworker to do alot of legwork, but essentially split the bold bits out and throw them into the pre-made elements with the right CSS applied. Leave the unneeded ones empty. A modulo operation would work, since the indices cycle. You'd just need a clever .exec() or similar to run through and split the description up, and enough pre-made attributes in each row to cope with a few style changes in a single description, since you can't dynamically add them later. So... "This is a " ==> attr_desc1 " description " ==> attr_desc2 "of an " ==> attr_desc4 " item " ==> attr_desc5 ... all inline so they're on the same line, of course. I can't see how this would be worth all the effort, but I guess it would work? :)
I have been considering this possibility too. Honestly, I might do that at some point, but getting the rest of the sheet done is more important for now.