// markup-spelling: old-spelling begin — the before/after table. package markup import ( "regexp" "strings" "testing" ) // TestTheGrammar pins the translation itself: kind, part, variant, // part-with-variant, tone, and the things that must NOT move — a // utility class, an app's own class, and the data-* attributes that // carry runtime state rather than authored vocabulary. func TestTheGrammar(t *testing.T) { for _, c := range []struct{ in, want string }{ // Kinds, parts, variants. {`
`, `
`}, {`
`, `
`}, {``, ``}, {``, ``}, {`
`, `
`}, {`
`, `
`}, // Two kinds on one element become two attributes. {`
`, `
`}, // A kind, a variant and a utility: an attribute AND a class. {``, ``}, {``, ``}, // Tone. {``, ``}, {`
`, `
`}, // Runtime state stays data-*. {`
`, ``}, {`
`, `
`}, // Not ours. {``, ``}, {`

`, `

`}, // The renames. {`

`, `
`}, {`
x
`, `
x
`}, // The deletion, including the space it took with it. {`
`, ``}, {`Filter`, `Filter`}, // A Go interpreted string literal keeps its own quoting. {`b.WriteString("")`, `b.WriteString("")`}, {`b.WriteString("
")`, `b.WriteString("
")`}, // Templated class lists: the conditional moves into the value. {``, ``}, {``, ``}, {`