2026-02-16 23:40:40 +00:00
|
|
|
package html
|
|
|
|
|
|
|
|
|
|
import "strings"
|
|
|
|
|
|
|
|
|
|
// ParseBlockID extracts the slot sequence from a data-block ID.
|
|
|
|
|
// "L-0-C-0" → ['L', 'C']
|
|
|
|
|
func ParseBlockID(id string) []byte {
|
|
|
|
|
if id == "" {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Split on "-" and take every other element (the slot letters).
|
|
|
|
|
// Format: "X-0" or "X-0-Y-0-Z-0"
|
|
|
|
|
var slots []byte
|
2026-02-23 05:11:04 +00:00
|
|
|
i := 0
|
|
|
|
|
for part := range strings.SplitSeq(id, "-") {
|
|
|
|
|
if i%2 == 0 && len(part) == 1 {
|
|
|
|
|
slots = append(slots, part[0])
|
2026-02-16 23:40:40 +00:00
|
|
|
}
|
2026-02-23 05:11:04 +00:00
|
|
|
i++
|
2026-02-16 23:40:40 +00:00
|
|
|
}
|
|
|
|
|
return slots
|
|
|
|
|
}
|