When a table contains empty values, sorting by IP addresses using the `ip-address.js` sorting plugin
caused erratic sorting behaviour. The empty lines are not sorted correctly and remain scattered about
the rest of the rows.
This seems to be due to a type issue: The ip-address sorting plugin has a guard-clause if-statement
that checks if the value that is to be sorted is false-y. In that case, the integer `0` is returned.
The function seems to usually normalise ip addresses to a lexicographically sortable format, and
values like `"86b4b93fbbf0418144b55bc45057b720"` and `"173040030054"` are returned.
The resulting comparison between strings and integers seems to cause misplaced empty rows and all-over
weird sorting behaviour.
This commit changes the value returned by the guard-clause to the string value `"000000000000"`, which
is simliar to the normalized IPv4 format already used by the plugin.
IP addresses can easily be hidden in HTML formed cells. For example an
IP that links to the IP via an href.
As such, add the naive and basic, but fast html tag stripper from the
core code.
Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
@Datatables, you are right, it should be better to use !a, then empty string case is covered as well.
And yes, I'm happy for this to be included under MIT licence.