package core

import "strings"

// ParseVersion extracts the version tag from the first word of the first line.
// For example, "v1.4.0 - Description" returns "v1.4.0".
// Returns "" if the input is empty.
func ParseVersion(content string) string {
	line := strings.SplitN(strings.TrimSpace(content), "\n", 2)[0]
	word := strings.Fields(line)
	if len(word) == 0 {
		return ""
	}
	return word[0]
}
