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

TableExport Script Request: Using as an escape

1632337638
I realized that if I manually add <br> in a rollable table item, it will insert a line break with the RecursiveTable output.  What's interesting is the <br> is visible while editing the item, but not from the Table Item List. Here's an example of what I want the output to look like - the roll for Coins, Art & Gems, and Magic Items each show up on separate lines: **Coin:** [[1d6*10]]SP & [[1d6*10]]GP<br> **Art & Gems:** [[1d8]] [[1t[Treasure500GPGems]]] (500GP)<br>**Magic Items:** [[[[1d4]]t[MagicItemTableA]]] Anyways, I was trying to figure out if there's a way to include a <br> when using TableExport to import items.  Is that functionality already built in, and I just missed it? It appears that they get removed while being imported, but I'm not sure if there's a way to escape them similar to <%%91%%> for [ and <%%93%%> for ].  I tried editing the 'escapes' section by adding:             '<br>'   : '<%%13%%>',  but it appears that something also needs to happen in the 'nameEscape' and 'nameUnescape' functions or somewhere else in the code. Any help would be greatly appreciated!
1632339505
I did figure out a way to do this, though it may not be the most efficient! In the escapes section (starting at line 11) I added two lines for < and >:         escapes = {             '<'   : '<%%60%%>',             '>'   : '<%%62%%>',             '['   : '<%%91%%>',             ']'   : '<%%93%%>',             '--' : '<%%-%%>',             ' --' : '[TABLEEXPORT:ESCAPE]'         }, Then in the imported code, wherever I need a <br> I use: <%%60%%>br<%%62%%>
1632347643
Andreas J.
Forum Champion
Sheet Author
Translator
You could try instead use %NEWLINE% <a href="https://app.roll20.net/forum/post/10170199/line-breaks-in-text-chat-and-the-percent-newline-percent-macro-trick/?pageforid=10170199#post-10170199" rel="nofollow">https://app.roll20.net/forum/post/10170199/line-breaks-in-text-chat-and-the-percent-newline-percent-macro-trick/?pageforid=10170199#post-10170199</a>
1632356094

Edited 1632356120
The Aaron
Forum Champion
API Scripter
How you've done it is the easiest way to accomplish it without rewriting the escaping function. The escaping function operates on individual characters, which is why the full strength didn't work.