(t *testing.T)
| 12 | ) |
| 13 | |
| 14 | func TestRemoveXMLComments(t *testing.T) { |
| 15 | tests := []struct { |
| 16 | name string |
| 17 | input string |
| 18 | expected string |
| 19 | }{ |
| 20 | { |
| 21 | name: "No XML comments", |
| 22 | input: "This is regular markdown content", |
| 23 | expected: "This is regular markdown content", |
| 24 | }, |
| 25 | { |
| 26 | name: "Single line XML comment", |
| 27 | input: "Before <!-- this is a comment --> after", |
| 28 | expected: "Before after", |
| 29 | }, |
| 30 | { |
| 31 | name: "XML comment at start of line", |
| 32 | input: "<!-- comment at start --> content", |
| 33 | expected: " content", |
| 34 | }, |
| 35 | { |
| 36 | name: "XML comment at end of line", |
| 37 | input: "content <!-- comment at end -->", |
| 38 | expected: "content ", |
| 39 | }, |
| 40 | { |
| 41 | name: "Entire line is XML comment", |
| 42 | input: "<!-- entire line comment -->", |
| 43 | expected: "", |
| 44 | }, |
| 45 | { |
| 46 | name: "Multiple XML comments on same line", |
| 47 | input: "<!-- first --> middle <!-- second --> end", |
| 48 | expected: " middle end", |
| 49 | }, |
| 50 | { |
| 51 | name: "Multiline XML comment", |
| 52 | input: `Before comment |
| 53 | <!-- this is a |
| 54 | multiline comment |
| 55 | that spans multiple lines --> |
| 56 | After comment`, |
| 57 | expected: `Before comment |
| 58 | |
| 59 | After comment`, |
| 60 | }, |
| 61 | { |
| 62 | name: "Multiple separate XML comments", |
| 63 | input: `First line |
| 64 | <!-- comment 1 --> |
| 65 | Middle line |
| 66 | <!-- comment 2 --> |
| 67 | Last line`, |
| 68 | expected: `First line |
| 69 | |
| 70 | Middle line |
| 71 |
nothing calls this directly
no test coverage detected