Skip to content

Commit 78e94da

Browse files
fix: Replace <br> with <br /> for markdown syntax
<br /> provides additional support for XHTML without breaking compatibility with HTML. This can be useful when trying to publish documentation generated by terraform-docs to XHTML based solutions Signed-off-by: christophe.vandekerchove <christophe.vandekerchove@scalepad.com>
1 parent 2f1d15d commit 78e94da

15 files changed

+46
-46
lines changed

docs/reference/markdown-table.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,15 @@ generates the following output:
148148
| <a name="input_bool-2"></a> [bool-2](#input\_bool-2) | It's bool number two. | `bool` | `false` | no |
149149
| <a name="input_bool-3"></a> [bool-3](#input\_bool-3) | n/a | `bool` | `true` | no |
150150
| <a name="input_bool_default_false"></a> [bool\_default\_false](#input\_bool\_default\_false) | n/a | `bool` | `false` | no |
151-
| <a name="input_input-with-code-block"></a> [input-with-code-block](#input\_input-with-code-block) | This is a complicated one. We need a newline.<br>And an example in a code block<pre>default = [<br> "machine rack01:neptune"<br>]</pre> | `list` | <pre>[<br> "name rack:location"<br>]</pre> | no |
151+
| <a name="input_input-with-code-block"></a> [input-with-code-block](#input\_input-with-code-block) | This is a complicated one. We need a newline.<br/>And an example in a code block<pre>default = [<br/> "machine rack01:neptune"<br/>]</pre> | `list` | <pre>[<br/> "name rack:location"<br/>]</pre> | no |
152152
| <a name="input_input-with-pipe"></a> [input-with-pipe](#input\_input-with-pipe) | It includes v1 \| v2 \| v3 | `string` | `"v1"` | no |
153153
| <a name="input_input_with_underscores"></a> [input\_with\_underscores](#input\_input\_with\_underscores) | A variable with underscores. | `any` | n/a | yes |
154-
| <a name="input_list-1"></a> [list-1](#input\_list-1) | It's list number one. | `list` | <pre>[<br> "a",<br> "b",<br> "c"<br>]</pre> | no |
154+
| <a name="input_list-1"></a> [list-1](#input\_list-1) | It's list number one. | `list` | <pre>[<br/> "a",<br/> "b",<br/> "c"<br/>]</pre> | no |
155155
| <a name="input_list-2"></a> [list-2](#input\_list-2) | It's list number two. | `list` | n/a | yes |
156156
| <a name="input_list-3"></a> [list-3](#input\_list-3) | n/a | `list` | `[]` | no |
157157
| <a name="input_list_default_empty"></a> [list\_default\_empty](#input\_list\_default\_empty) | n/a | `list(string)` | `[]` | no |
158-
| <a name="input_long_type"></a> [long\_type](#input\_long\_type) | This description is itself markdown.<br><br>It spans over multiple lines. | <pre>object({<br> name = string,<br> foo = object({ foo = string, bar = string }),<br> bar = object({ foo = string, bar = string }),<br> fizz = list(string),<br> buzz = list(string)<br> })</pre> | <pre>{<br> "bar": {<br> "bar": "bar",<br> "foo": "bar"<br> },<br> "buzz": [<br> "fizz",<br> "buzz"<br> ],<br> "fizz": [],<br> "foo": {<br> "bar": "foo",<br> "foo": "foo"<br> },<br> "name": "hello"<br>}</pre> | no |
159-
| <a name="input_map-1"></a> [map-1](#input\_map-1) | It's map number one. | `map` | <pre>{<br> "a": 1,<br> "b": 2,<br> "c": 3<br>}</pre> | no |
158+
| <a name="input_long_type"></a> [long\_type](#input\_long\_type) | This description is itself markdown.<br/><br/>It spans over multiple lines. | <pre>object({<br/> name = string,<br/> foo = object({ foo = string, bar = string }),<br/> bar = object({ foo = string, bar = string }),<br/> fizz = list(string),<br/> buzz = list(string)<br/> })</pre> | <pre>{<br/> "bar": {<br/> "bar": "bar",<br/> "foo": "bar"<br/> },<br/> "buzz": [<br/> "fizz",<br/> "buzz"<br/> ],<br/> "fizz": [],<br/> "foo": {<br/> "bar": "foo",<br/> "foo": "foo"<br/> },<br/> "name": "hello"<br/>}</pre> | no |
159+
| <a name="input_map-1"></a> [map-1](#input\_map-1) | It's map number one. | `map` | <pre>{<br/> "a": 1,<br/> "b": 2,<br/> "c": 3<br/>}</pre> | no |
160160
| <a name="input_map-2"></a> [map-2](#input\_map-2) | It's map number two. | `map` | n/a | yes |
161161
| <a name="input_map-3"></a> [map-3](#input\_map-3) | n/a | `map` | `{}` | no |
162162
| <a name="input_no-escape-default-value"></a> [no-escape-default-value](#input\_no-escape-default-value) | The description contains `something_with_underscore`. Defaults to 'VALUE\_WITH\_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` | no |

format/testdata/markdown/table-Base.golden

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,14 @@ followed by another line of text.
9292
| number-1 | It's number number one. | `number` | `42` |
9393
| map-3 | n/a | `map` | `{}` |
9494
| map-2 | It's map number two. | `map` | n/a |
95-
| map-1 | It's map number one. | `map` | <pre>{<br> "a": 1,<br> "b": 2,<br> "c": 3<br>}</pre> |
95+
| map-1 | It's map number one. | `map` | <pre>{<br/> "a": 1,<br/> "b": 2,<br/> "c": 3<br/>}</pre> |
9696
| list-3 | n/a | `list` | `[]` |
9797
| list-2 | It's list number two. | `list` | n/a |
98-
| list-1 | It's list number one. | `list` | <pre>[<br> "a",<br> "b",<br> "c"<br>]</pre> |
98+
| list-1 | It's list number one. | `list` | <pre>[<br/> "a",<br/> "b",<br/> "c"<br/>]</pre> |
9999
| input_with_underscores | A variable with underscores. | `any` | n/a |
100100
| input-with-pipe | It includes v1 \| v2 \| v3 | `string` | `"v1"` |
101-
| input-with-code-block | This is a complicated one. We need a newline.<br>And an example in a code block<pre>default = [<br> "machine rack01:neptune"<br>]</pre> | `list` | <pre>[<br> "name rack:location"<br>]</pre> |
102-
| long_type | This description is itself markdown.<br><br>It spans over multiple lines. | <pre>object({<br> name = string,<br> foo = object({ foo = string, bar = string }),<br> bar = object({ foo = string, bar = string }),<br> fizz = list(string),<br> buzz = list(string)<br> })</pre> | <pre>{<br> "bar": {<br> "bar": "bar",<br> "foo": "bar"<br> },<br> "buzz": [<br> "fizz",<br> "buzz"<br> ],<br> "fizz": [],<br> "foo": {<br> "bar": "foo",<br> "foo": "foo"<br> },<br> "name": "hello"<br>}</pre> |
101+
| input-with-code-block | This is a complicated one. We need a newline.<br/>And an example in a code block<pre>default = [<br/> "machine rack01:neptune"<br/>]</pre> | `list` | <pre>[<br/> "name rack:location"<br/>]</pre> |
102+
| long_type | This description is itself markdown.<br/><br/>It spans over multiple lines. | <pre>object({<br/> name = string,<br/> foo = object({ foo = string, bar = string }),<br/> bar = object({ foo = string, bar = string }),<br/> fizz = list(string),<br/> buzz = list(string)<br/> })</pre> | <pre>{<br/> "bar": {<br/> "bar": "bar",<br/> "foo": "bar"<br/> },<br/> "buzz": [<br/> "fizz",<br/> "buzz"<br/> ],<br/> "fizz": [],<br/> "foo": {<br/> "bar": "foo",<br/> "foo": "foo"<br/> },<br/> "name": "hello"<br/>}</pre> |
103103
| no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` |
104104
| with-url | The description contains url. https://www.domain.com/foo/bar_baz.html | `string` | `""` |
105105
| string_default_empty | n/a | `string` | `""` |

format/testdata/markdown/table-EscapeCharacters.golden

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,14 @@ followed by another line of text.
9292
| number-1 | It's number number one. | `number` | `42` |
9393
| map-3 | n/a | `map` | `{}` |
9494
| map-2 | It's map number two. | `map` | n/a |
95-
| map-1 | It's map number one. | `map` | <pre>{<br> "a": 1,<br> "b": 2,<br> "c": 3<br>}</pre> |
95+
| map-1 | It's map number one. | `map` | <pre>{<br/> "a": 1,<br/> "b": 2,<br/> "c": 3<br/>}</pre> |
9696
| list-3 | n/a | `list` | `[]` |
9797
| list-2 | It's list number two. | `list` | n/a |
98-
| list-1 | It's list number one. | `list` | <pre>[<br> "a",<br> "b",<br> "c"<br>]</pre> |
98+
| list-1 | It's list number one. | `list` | <pre>[<br/> "a",<br/> "b",<br/> "c"<br/>]</pre> |
9999
| input\_with\_underscores | A variable with underscores. | `any` | n/a |
100100
| input-with-pipe | It includes v1 \| v2 \| v3 | `string` | `"v1"` |
101-
| input-with-code-block | This is a complicated one. We need a newline.<br>And an example in a code block<pre>default = [<br> "machine rack01:neptune"<br>]</pre> | `list` | <pre>[<br> "name rack:location"<br>]</pre> |
102-
| long\_type | This description is itself markdown.<br><br>It spans over multiple lines. | <pre>object({<br> name = string,<br> foo = object({ foo = string, bar = string }),<br> bar = object({ foo = string, bar = string }),<br> fizz = list(string),<br> buzz = list(string)<br> })</pre> | <pre>{<br> "bar": {<br> "bar": "bar",<br> "foo": "bar"<br> },<br> "buzz": [<br> "fizz",<br> "buzz"<br> ],<br> "fizz": [],<br> "foo": {<br> "bar": "foo",<br> "foo": "foo"<br> },<br> "name": "hello"<br>}</pre> |
101+
| input-with-code-block | This is a complicated one. We need a newline.<br/>And an example in a code block<pre>default = [<br/> "machine rack01:neptune"<br/>]</pre> | `list` | <pre>[<br/> "name rack:location"<br/>]</pre> |
102+
| long\_type | This description is itself markdown.<br/><br/>It spans over multiple lines. | <pre>object({<br/> name = string,<br/> foo = object({ foo = string, bar = string }),<br/> bar = object({ foo = string, bar = string }),<br/> fizz = list(string),<br/> buzz = list(string)<br/> })</pre> | <pre>{<br/> "bar": {<br/> "bar": "bar",<br/> "foo": "bar"<br/> },<br/> "buzz": [<br/> "fizz",<br/> "buzz"<br/> ],<br/> "fizz": [],<br/> "foo": {<br/> "bar": "foo",<br/> "foo": "foo"<br/> },<br/> "name": "hello"<br/>}</pre> |
103103
| no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE\_WITH\_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` |
104104
| with-url | The description contains url. https://www.domain.com/foo/bar_baz.html | `string` | `""` |
105105
| string\_default\_empty | n/a | `string` | `""` |

format/testdata/markdown/table-IndentationOfFour.golden

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,14 @@ followed by another line of text.
9292
| number-1 | It's number number one. | `number` | `42` |
9393
| map-3 | n/a | `map` | `{}` |
9494
| map-2 | It's map number two. | `map` | n/a |
95-
| map-1 | It's map number one. | `map` | <pre>{<br> "a": 1,<br> "b": 2,<br> "c": 3<br>}</pre> |
95+
| map-1 | It's map number one. | `map` | <pre>{<br/> "a": 1,<br/> "b": 2,<br/> "c": 3<br/>}</pre> |
9696
| list-3 | n/a | `list` | `[]` |
9797
| list-2 | It's list number two. | `list` | n/a |
98-
| list-1 | It's list number one. | `list` | <pre>[<br> "a",<br> "b",<br> "c"<br>]</pre> |
98+
| list-1 | It's list number one. | `list` | <pre>[<br/> "a",<br/> "b",<br/> "c"<br/>]</pre> |
9999
| input_with_underscores | A variable with underscores. | `any` | n/a |
100100
| input-with-pipe | It includes v1 \| v2 \| v3 | `string` | `"v1"` |
101-
| input-with-code-block | This is a complicated one. We need a newline.<br>And an example in a code block<pre>default = [<br> "machine rack01:neptune"<br>]</pre> | `list` | <pre>[<br> "name rack:location"<br>]</pre> |
102-
| long_type | This description is itself markdown.<br><br>It spans over multiple lines. | <pre>object({<br> name = string,<br> foo = object({ foo = string, bar = string }),<br> bar = object({ foo = string, bar = string }),<br> fizz = list(string),<br> buzz = list(string)<br> })</pre> | <pre>{<br> "bar": {<br> "bar": "bar",<br> "foo": "bar"<br> },<br> "buzz": [<br> "fizz",<br> "buzz"<br> ],<br> "fizz": [],<br> "foo": {<br> "bar": "foo",<br> "foo": "foo"<br> },<br> "name": "hello"<br>}</pre> |
101+
| input-with-code-block | This is a complicated one. We need a newline.<br/>And an example in a code block<pre>default = [<br/> "machine rack01:neptune"<br/>]</pre> | `list` | <pre>[<br/> "name rack:location"<br/>]</pre> |
102+
| long_type | This description is itself markdown.<br/><br/>It spans over multiple lines. | <pre>object({<br/> name = string,<br/> foo = object({ foo = string, bar = string }),<br/> bar = object({ foo = string, bar = string }),<br/> fizz = list(string),<br/> buzz = list(string)<br/> })</pre> | <pre>{<br/> "bar": {<br/> "bar": "bar",<br/> "foo": "bar"<br/> },<br/> "buzz": [<br/> "fizz",<br/> "buzz"<br/> ],<br/> "fizz": [],<br/> "foo": {<br/> "bar": "foo",<br/> "foo": "foo"<br/> },<br/> "name": "hello"<br/>}</pre> |
103103
| no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` |
104104
| with-url | The description contains url. https://www.domain.com/foo/bar_baz.html | `string` | `""` |
105105
| string_default_empty | n/a | `string` | `""` |

format/testdata/markdown/table-OutputValues.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
| Name | Description | Value | Sensitive |
44
|------|-------------|-------|:---------:|
5-
| unquoted | It's unquoted output. | <pre>{<br> "leon": "cat"<br>}</pre> | no |
6-
| output-2 | It's output number two. | <pre>[<br> "jack",<br> "lola"<br>]</pre> | no |
5+
| unquoted | It's unquoted output. | <pre>{<br/> "leon": "cat"<br/>}</pre> | no |
6+
| output-2 | It's output number two. | <pre>[<br/> "jack",<br/> "lola"<br/>]</pre> | no |
77
| output-1 | It's output number one. | `1` | no |
88
| output-0.12 | terraform 0.12 only | `<sensitive>` | yes |

format/testdata/markdown/table-OutputValuesNoSensitivity.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
| Name | Description | Value |
44
|------|-------------|-------|
5-
| unquoted | It's unquoted output. | <pre>{<br> "leon": "cat"<br>}</pre> |
6-
| output-2 | It's output number two. | <pre>[<br> "jack",<br> "lola"<br>]</pre> |
5+
| unquoted | It's unquoted output. | <pre>{<br/> "leon": "cat"<br/>}</pre> |
6+
| output-2 | It's output number two. | <pre>[<br/> "jack",<br/> "lola"<br/>]</pre> |
77
| output-1 | It's output number one. | `1` |
88
| output-0.12 | terraform 0.12 only | `<sensitive>` |

format/testdata/markdown/table-WithAnchor.golden

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,14 @@ followed by another line of text.
9292
| <a name="input_number-1"></a> [number-1](#input_number-1) | It's number number one. | `number` | `42` |
9393
| <a name="input_map-3"></a> [map-3](#input_map-3) | n/a | `map` | `{}` |
9494
| <a name="input_map-2"></a> [map-2](#input_map-2) | It's map number two. | `map` | n/a |
95-
| <a name="input_map-1"></a> [map-1](#input_map-1) | It's map number one. | `map` | <pre>{<br> "a": 1,<br> "b": 2,<br> "c": 3<br>}</pre> |
95+
| <a name="input_map-1"></a> [map-1](#input_map-1) | It's map number one. | `map` | <pre>{<br/> "a": 1,<br/> "b": 2,<br/> "c": 3<br/>}</pre> |
9696
| <a name="input_list-3"></a> [list-3](#input_list-3) | n/a | `list` | `[]` |
9797
| <a name="input_list-2"></a> [list-2](#input_list-2) | It's list number two. | `list` | n/a |
98-
| <a name="input_list-1"></a> [list-1](#input_list-1) | It's list number one. | `list` | <pre>[<br> "a",<br> "b",<br> "c"<br>]</pre> |
98+
| <a name="input_list-1"></a> [list-1](#input_list-1) | It's list number one. | `list` | <pre>[<br/> "a",<br/> "b",<br/> "c"<br/>]</pre> |
9999
| <a name="input_input_with_underscores"></a> [input_with_underscores](#input_input_with_underscores) | A variable with underscores. | `any` | n/a |
100100
| <a name="input_input-with-pipe"></a> [input-with-pipe](#input_input-with-pipe) | It includes v1 \| v2 \| v3 | `string` | `"v1"` |
101-
| <a name="input_input-with-code-block"></a> [input-with-code-block](#input_input-with-code-block) | This is a complicated one. We need a newline.<br>And an example in a code block<pre>default = [<br> "machine rack01:neptune"<br>]</pre> | `list` | <pre>[<br> "name rack:location"<br>]</pre> |
102-
| <a name="input_long_type"></a> [long_type](#input_long_type) | This description is itself markdown.<br><br>It spans over multiple lines. | <pre>object({<br> name = string,<br> foo = object({ foo = string, bar = string }),<br> bar = object({ foo = string, bar = string }),<br> fizz = list(string),<br> buzz = list(string)<br> })</pre> | <pre>{<br> "bar": {<br> "bar": "bar",<br> "foo": "bar"<br> },<br> "buzz": [<br> "fizz",<br> "buzz"<br> ],<br> "fizz": [],<br> "foo": {<br> "bar": "foo",<br> "foo": "foo"<br> },<br> "name": "hello"<br>}</pre> |
101+
| <a name="input_input-with-code-block"></a> [input-with-code-block](#input_input-with-code-block) | This is a complicated one. We need a newline.<br/>And an example in a code block<pre>default = [<br/> "machine rack01:neptune"<br/>]</pre> | `list` | <pre>[<br/> "name rack:location"<br/>]</pre> |
102+
| <a name="input_long_type"></a> [long_type](#input_long_type) | This description is itself markdown.<br/><br/>It spans over multiple lines. | <pre>object({<br/> name = string,<br/> foo = object({ foo = string, bar = string }),<br/> bar = object({ foo = string, bar = string }),<br/> fizz = list(string),<br/> buzz = list(string)<br/> })</pre> | <pre>{<br/> "bar": {<br/> "bar": "bar",<br/> "foo": "bar"<br/> },<br/> "buzz": [<br/> "fizz",<br/> "buzz"<br/> ],<br/> "fizz": [],<br/> "foo": {<br/> "bar": "foo",<br/> "foo": "foo"<br/> },<br/> "name": "hello"<br/>}</pre> |
103103
| <a name="input_no-escape-default-value"></a> [no-escape-default-value](#input_no-escape-default-value) | The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` |
104104
| <a name="input_with-url"></a> [with-url](#input_with-url) | The description contains url. https://www.domain.com/foo/bar_baz.html | `string` | `""` |
105105
| <a name="input_string_default_empty"></a> [string_default_empty](#input_string_default_empty) | n/a | `string` | `""` |

format/testdata/markdown/table-WithRequired.golden

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,14 @@ followed by another line of text.
9292
| number-1 | It's number number one. | `number` | `42` | no |
9393
| map-3 | n/a | `map` | `{}` | no |
9494
| map-2 | It's map number two. | `map` | n/a | yes |
95-
| map-1 | It's map number one. | `map` | <pre>{<br> "a": 1,<br> "b": 2,<br> "c": 3<br>}</pre> | no |
95+
| map-1 | It's map number one. | `map` | <pre>{<br/> "a": 1,<br/> "b": 2,<br/> "c": 3<br/>}</pre> | no |
9696
| list-3 | n/a | `list` | `[]` | no |
9797
| list-2 | It's list number two. | `list` | n/a | yes |
98-
| list-1 | It's list number one. | `list` | <pre>[<br> "a",<br> "b",<br> "c"<br>]</pre> | no |
98+
| list-1 | It's list number one. | `list` | <pre>[<br/> "a",<br/> "b",<br/> "c"<br/>]</pre> | no |
9999
| input_with_underscores | A variable with underscores. | `any` | n/a | yes |
100100
| input-with-pipe | It includes v1 \| v2 \| v3 | `string` | `"v1"` | no |
101-
| input-with-code-block | This is a complicated one. We need a newline.<br>And an example in a code block<pre>default = [<br> "machine rack01:neptune"<br>]</pre> | `list` | <pre>[<br> "name rack:location"<br>]</pre> | no |
102-
| long_type | This description is itself markdown.<br><br>It spans over multiple lines. | <pre>object({<br> name = string,<br> foo = object({ foo = string, bar = string }),<br> bar = object({ foo = string, bar = string }),<br> fizz = list(string),<br> buzz = list(string)<br> })</pre> | <pre>{<br> "bar": {<br> "bar": "bar",<br> "foo": "bar"<br> },<br> "buzz": [<br> "fizz",<br> "buzz"<br> ],<br> "fizz": [],<br> "foo": {<br> "bar": "foo",<br> "foo": "foo"<br> },<br> "name": "hello"<br>}</pre> | no |
101+
| input-with-code-block | This is a complicated one. We need a newline.<br/>And an example in a code block<pre>default = [<br/> "machine rack01:neptune"<br/>]</pre> | `list` | <pre>[<br/> "name rack:location"<br/>]</pre> | no |
102+
| long_type | This description is itself markdown.<br/><br/>It spans over multiple lines. | <pre>object({<br/> name = string,<br/> foo = object({ foo = string, bar = string }),<br/> bar = object({ foo = string, bar = string }),<br/> fizz = list(string),<br/> buzz = list(string)<br/> })</pre> | <pre>{<br/> "bar": {<br/> "bar": "bar",<br/> "foo": "bar"<br/> },<br/> "buzz": [<br/> "fizz",<br/> "buzz"<br/> ],<br/> "fizz": [],<br/> "foo": {<br/> "bar": "foo",<br/> "foo": "foo"<br/> },<br/> "name": "hello"<br/>}</pre> | no |
103103
| no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` | no |
104104
| with-url | The description contains url. https://www.domain.com/foo/bar_baz.html | `string` | `""` | no |
105105
| string_default_empty | n/a | `string` | `""` | no |

0 commit comments

Comments
 (0)