Sort Hierarchy items in "counting order"

When given the following hierarchical items
H/1
H/4
H/12
H/23

Current Logseq Sort:
H/1
H/12
H/23
H/4

Desired Logseq Sort:
H/1
H/4
H/12
H/23

12 and 23 come after 4

I think that more generally, one could use a “smart sort” whenever LogSeq displays data to the user in an ordered way. Something like this:

  1. Detect natural boundaries in the text, and split at those: For example, 12Feb2015 -> "12", "Feb", "2015" or Track 1: Hello world -> "Track ", "1", ": ", "Hello world"
  2. For each token, find out whether there is a common type. For example, if token[0] is numeric for all lines, then treat it as a number. If all of them are month names, then interpret as month.
  3. Convert each token to its appropriate type and construct a tuple of values. In our example above, that would become (12, 02, 2015) or ("Track ", 1, ": ", "Hello world").
  4. Sort the items using this tuple value as key.