Difference between revisions of "HTML Entities"
From Roll20 Wiki
Andreas J. (Talk | contribs) m |
(added more legible alternatives for reference) |
||
Line 13: | Line 13: | ||
! Character || Replacement | ! Character || Replacement | ||
|- | |- | ||
− | | <code>|</code> (pipe) || <code>&#124;</code> | + | | <code>|</code> (pipe) || <code>&#124;</code>, (<code>&vert;</code>) |
|- | |- | ||
− | | <code>,</code>|| <code>&#44;</code> | + | | <code>,</code>|| <code>&#44;</code>, (<code>&comma;</code>) |
|- | |- | ||
| <code>{</code>|| <code>&#123;</code>, (<code>&lbrace;</code>) | | <code>{</code>|| <code>&#123;</code>, (<code>&lbrace;</code>) | ||
Line 25: | Line 25: | ||
| <code>space</code> || <code>&#160;</code>, (<code>&nbsp;</code>) | | <code>space</code> || <code>&#160;</code>, (<code>&nbsp;</code>) | ||
|- | |- | ||
− | | <code>=</code> || <code>&#61;</code> | + | | <code>=</code> || <code>&#61;</code>, (<code>&equals;</code>) |
|- | |- | ||
− | | <code>_</code> || <code>&#95;</code> | + | | <code>_</code> || <code>&#95;</code>, (<code>&lowbar;</code>) |
|- | |- | ||
− | | <code><nowiki>(</nowiki></code> || <code>&#40;</code> | + | | <code><nowiki>(</nowiki></code> || <code>&#40;</code>, (<code>&lpar;</code>) |
|- | |- | ||
− | | <code><nowiki>)</nowiki></code> || <code>&#41;</code> | + | | <code><nowiki>)</nowiki></code> || <code>&#41;</code>, (<code>&lpar;</code>) |
|- | |- | ||
| <code><nowiki>[</nowiki></code> || <code>&#91;</code>, (<code>&lbrack;</code>) | | <code><nowiki>[</nowiki></code> || <code>&#91;</code>, (<code>&lbrack;</code>) | ||
Line 37: | Line 37: | ||
| <code><nowiki>]</nowiki></code> || <code>&#93;</code>, (<code>&rbrack;</code>) | | <code><nowiki>]</nowiki></code> || <code>&#93;</code>, (<code>&rbrack;</code>) | ||
|- | |- | ||
− | | <code><nowiki><</nowiki></code> || <code>&#60;</code>, (<code>&lt;</code>) | + | | <code><nowiki><</nowiki></code> || <code>&#60;</code>, (<code>&lt;</code>) |
|- | |- | ||
| <code><nowiki>></nowiki></code> || <code>&#62;</code>, (<code>&gt;</code>) | | <code><nowiki>></nowiki></code> || <code>&#62;</code>, (<code>&gt;</code>) | ||
|- | |- | ||
− | | <code><nowiki>`</nowiki></code>(backtick, grave accent) || <code>&#96;</code> | + | | <code><nowiki>`</nowiki></code>(backtick, grave accent) || <code>&#96;</code>, (<code>&grave;</code>) |
|- | |- | ||
− | | {{c|*}}(asterisk)|| <code>&#42;</code> | + | | {{c|*}}(asterisk)|| <code>&#42;</code>, (<code>&ast;</code>) |
|- | |- | ||
− | | {{c|!}} || <code>&#33;</code> | + | | {{c|!}} || <code>&#33;</code>, (<code>&excl;</code>) |
|- | |- | ||
− | | {{c|"}}(doublequote)|| <code>&#34;</code> | + | | {{c|"}}(doublequote)|| <code>&#34;</code>, (<code>&quot;</code>) |
|- | |- | ||
− | | {{c|#}} || <code>&#35;</code> | + | | {{c|#}} || <code>&#35;</code>, (<code>&num;</code>) |
|- | |- | ||
− | | {{c|-}}(hyphen) || <code>&#45;</code> | + | | {{c|-}}(hyphen) || <code>&#45;</code>, (<code>&dash;</code>) |
|- | |- | ||
− | | {{c|@}} || <code>&#64;</code> | + | | {{c|@}} || <code>&#64;</code>, (<code>&commat;</code>) |
|} | |} | ||
</onlyinclude> | </onlyinclude> |
Revision as of 08:50, 21 September 2024
Page Updated: 2024-09-21 |
Macro Creation
- Complete Guide to Macros & Rolls
- q Text Chat
- Dice Reference
- Order of Operations
- Macros
- Token Reference
- Character Reference
- Roll Templates
- Roll Table
Advanced
- Formatting
- HTML Replacement
- Chat Menus
- Hidden Rolls
- Advanced Macro Tips
- API Commands
- Char Sheet Creation
- External tools
Misc.
Main Page: Macro Guide
HTML Entities (a.k.a. HTML Escape Characters) can be useful to escape HTML characters so they aren't processed prematurely. This is useful in creating macros, Building Character Sheets, and wiki editing.
When creating some complicated macros, usually involving nesting, you will need to use HTML entities in parts of the code to trick the Roll20 system to make it behave like you want, or some advanced tricks won't work.
Here are some HTML Entities/Escape Characters that are commonly useful to escape when creating advanced Roll20 macros. See HTML Entities or special character for more:
| , } , and , are the most common character that need to be replaced in nested macros. |
Character Replacement |
(pipe)|
, (|
),
,
, (,
){
{
, ({
)}
}
, (}
)&
&
, (&
)space
 
, (
)=
=
, (=
)_
_
, (_
)(
(
, ((
))
)
, ((
)[
[
, ([
)]
]
, (]
)<
<
, (<
)>
>
, (>
)`
(backtick, grave accent)`
, (`
)*
(asterisk)*
, (*
)!
!
, (!
)"
(doublequote)"
, ("
)#
#
, (#
)-
(hyphen)-
, (‐
)@
@
, (@
)
Examples
Main Page: Roll Queries & Nesting
By using HTML entities to replace all }
inside "Choose a Roll", it will now correctly process where the query ends. This is essentially to prevent the Roll Query from closing at the first }
it encounters.
?{Choose a Roll| STR,/roll 1d20 + 3 + (?{Modifier}) | DEX,/roll 1d20 + 2 + (?{Modifier}) | CON,/roll 1d20 + 1 + (?{Modifier}) }
If your query options contains |
, you need to replace them to prevent the query thinking it's a delimiter between options.
?{Pick a pair|Alice|Bob|Bob|Charlie}
Coming Update: Nested Query Improvement
Now on Dev Server: Roll Query Improvements! July 20th, 2021
In the near future, some, if not all, character substitutions might become redundant, when roll20 improves nested Roll Query handling in macros.
- Now on the Dev Server(Proinfo-users) for testing, improved roll query parsing!
- Recently, an update to our character sheet code broke a workaround that some sheets were using to implement nested roll queries. Rather than fixing this workaround, we did a little extra work to properly support nested queries. Now, you should be able to nest roll queries inside of each other without needing to use any character codes.