-
Notifications
You must be signed in to change notification settings - Fork 7
escape strings for xml #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
module. centralize color selection, and change color scheme. Differentiate used and unused rules by color.
also add the security table for iptables.
Show return paths for --jump and --goto.
@@ -45,30 +45,43 @@ def get_node_name(table_name, chain_name): | |||
def get_port_name(rule_index): | |||
return "rule_" + str(rule_index) | |||
|
|||
|
|||
xml_esc = { | |||
re.compile('&') : '&' , |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about over-long characters in UTF-8 and <![CDATA[
for XHTML? I think, better to use ready to use library than trying to escape only limited set of characters by handwritten code. Moreover, substitution by multiple regular expressions is very ineffective (as same symbol in each line must be reviewed multiple times). And such approach is error-prone, as the whole result depend on the orded in which you are applying substitutions. You can construct a single regular expression for this.
Rules like the following break the dot xml format.
-A PREROUTING -m u32 --u32 "0x6>>0x18=0x6" -j ACCEPT