Drasil: Check for Invalid Characters in Strings for Printing

Created on 10 Jun 2019  路  4Comments  路  Source: JacquesCarette/Drasil

Printing % as a string in LaTeX starts a comment, which best case doesn't print the "%" and worst case breaks the LaTeX code. All "%" in strings to be printed should be removed.

Most helpful comment

Not "removed" nor "escaped". Finding a % in a String destined for LaTeX should be a hard error. And indeed for the others that @Mornix mentions. We should not be embedding such characters in our English ever!

All 4 comments

Does the LaTeX printer have an existing function for character escaping?

When addPercent is used, the '%' is escaped, but percent signs aren't automatically checked for in the strings, if that's what you're asking.

This ought to be something printers account for before adding contents to a Doc and is likely a better/complimentary idea as each language has its own set of "meaningful" characters and strings. For example, < and > should be escaped in HTML, \ $ to name a few for LaTeX.

Not "removed" nor "escaped". Finding a % in a String destined for LaTeX should be a hard error. And indeed for the others that @Mornix mentions. We should not be embedding such characters in our English ever!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

samm82 picture samm82  路  12Comments

samm82 picture samm82  路  8Comments

samm82 picture samm82  路  3Comments

samm82 picture samm82  路  3Comments

samm82 picture samm82  路  10Comments