On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(+2)

Just to make sure you're clear on the distinction, a field's .value attribute is a table, and a field's .text attribute is a string:

An rtext table can contain hyperlinks, inline images, and multiple fonts, but a plain string cannot. In many situations that ask for an rtext table you can supply a string and it will be "widened" into rtext, but it will all be in the default font. If you copy the .value of one rich text field to another it will preserve its formatting, but if you copy the .text you will flatten it out into a plain text representation.

(For anyone with web development experience, field.value versus field.text is loosely similar to element.innerHTML versus element.innerText.)

Decker 1.34 introduced a new "rtext.replace[]" utility function that might be handy. If you're working with a lot of text, links, and cards, it might be useful to write a deck-level utility function that finds certain keywords in a string or rtext table and replaces them with appropriate links, which you could then call whenever you populate a field. For example, perhaps something like this:

on contextualize text do
  db:insert keyword replacement with
   "Alien"  rtext.make["Alien"  "" "About Aliens"     ]
   "Weapon" rtext.make["Weapon" "" "Weaponry"         ]
   "Snacks" rtext.make["Snacks" "" "Delicious Treats" ]
   "Zombo"  rtext.make["Zombo"  "" "https://zombo.com"]
  end
  rtext.replace[text db.keyword db.replacement]
end

There's basically no limit to the possible complexity here (for example, you could automatically populate the keyword list by inspecting the titles of cards in the current deck), so it's up to you to choose what makes sense to you and is reasonably convenient for your purposes.

(+1)

First off I really appreciate your time in providing practical solutions. I gave this my best shot before returning here but every attempt I made at implementing the utility function you provided, at either the deck level down to the control itself, did not seem to work. I could get it to work within the Listener, but any table expressions seemed to do nothing outside of Listener. I'm sure I'm missing something, but I couldn't find a solution or workaround. 

(+1)

Are you writing the result into a widget?

If you had a rich text field named "foo" which contained some of the words defined in the table for contextualize[], you'd apply it to the field something like this:

foo.value:contextualize[foo.value]
  • reading "foo.value" produces a rich text table.
  • "contextualize[foo.value] " calls the contextualize function with that rich text table and returns a modified rich text table.
  • the colon (:) is the assignment operator in Lil.
(+1)

As I anticipated, my issue was a syntax one and I wasn't properly calling "contextualize". I also unnecessarily added a comma delimiter to each of the rtext.make[] functions (I use Power Apps and JSON a lot with work). Everything is working as intended now, thank you!