This is a CodeMirror mode that brings
syntax highlighting for IP addresses.
MIME types defined
text/x-ip-address (default)
text/x-ipv4-address (consider IPv6 addresses as errors)
text/x-ipv6-address (consider IPv4 addresses as errors)
Supported formats
IPv6
IPv4
Addresses
CIDR
Ranges
Dual addresses
Options:
ipv4_ranges: boolean: accept IPv4 ranges, e.g. 10.0.0.0-10.255.255.255
ipv6_ranges: boolean: accept IPv6 ranges, e.g. 2001:0db8::-2001:0db8:ffff::
ipv4_cidr: boolean: accept IPv4 CIDR suffixes, e.g. 10.0.0.0/8
ipv6_cidr: boolean: accept IPv6 CIDR suffixes, e.g. 2001:db8::/32
strict: boolean: strict mode
All options above default to true.
Strict mode
If strict mode is enabled, only one value (address, range or CIDR) will be parsed; everything else will be marked as erroneous.
Example with an IP range:
If strict mode is disabled, codemirror-mode-ipaddr parses and highlights all IP addresses in the text editor: