diff --git a/docs/formats/json.md b/docs/formats/json.md
index a13014c..610a1ed 100644
--- a/docs/formats/json.md
+++ b/docs/formats/json.md
@@ -35,7 +35,7 @@ generates the following output:
```json
{
- "header": "Usage:\n\nExample of 'foo_bar' module in `foo_bar.tf`.\n\n```hcl\nmodule \"foo_bar\" {\n source = \"github.com/foo/bar\"\n\n id = \"1234567890\"\n name = \"baz\"\n\n zones = [\"us-east-1\", \"us-west-1\"]\n\n tags = {\n Name = \"baz\"\n Created-By = \"first.last@email.com\"\n Date-Created = \"20180101\"\n }\n}\n```",
+ "header": "Usage:\n\nExample of 'foo_bar' module in `foo_bar.tf`.\n\n```hcl\nmodule \"foo_bar\" {\n source = \"github.com/foo/bar\"\n\n id = \"1234567890\"\n name = \"baz\"\n\n zones = [\"us-east-1\", \"us-west-1\"]\n\n tags = {\n Name = \"baz\"\n Created-By = \"first.last@email.com\"\n Date-Created = \"20180101\"\n }\n}\n```\n\nHere is some trailing text after code block,\nfollowed by another line of text.",
"inputs": [
{
"name": "input-with-code-block",
diff --git a/docs/formats/markdown-document.md b/docs/formats/markdown-document.md
index ddfaf75..a080c24 100644
--- a/docs/formats/markdown-document.md
+++ b/docs/formats/markdown-document.md
@@ -59,6 +59,9 @@ generates the following output:
}
```
+ Here is some trailing text after code block,
+ followed by another line of text.
+
## Providers
The following providers are used by this module:
@@ -113,7 +116,6 @@ generates the following output:
Description: This is a complicated one. We need a newline.
And an example in a code block
-
```
default = [
"machine rack01:neptune"
diff --git a/docs/formats/markdown-table.md b/docs/formats/markdown-table.md
index 4b1b53b..305d676 100644
--- a/docs/formats/markdown-table.md
+++ b/docs/formats/markdown-table.md
@@ -59,6 +59,9 @@ generates the following output:
}
```
+ Here is some trailing text after code block,
+ followed by another line of text.
+
## Providers
| Name | Version |
@@ -72,14 +75,14 @@ generates the following output:
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:-----:|
- | input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block | `list` | default = [
"machine rack01:neptune"
] | no |
+ | input-with-code-block | This is a complicated one. We need a newline.[
"name rack:location"
]
And an example in a code block
default = [| `list` |
"machine rack01:neptune"
]
[| no | | input-with-pipe | It includes v1 \| v2 \| v3 | `string` | `"v1"` | no | | input\_with\_underscores | A variable with underscores. | `any` | n/a | yes | - | list-1 | It's list number one. | `list` |
"name rack:location"
]
[
"a",
"b",
"c"
]
| no |
+ | list-1 | It's list number one. | `list` | [| no | | list-2 | It's list number two. | `list` | n/a | yes | | list-3 | n/a | `list` | `[]` | no | - | long\_type | This description is itself markdown.
"a",
"b",
"c"
]
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
| {
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| no |
- | map-1 | It's map number one. | `map` | {
"a": 1,
"b": 2,
"c": 3
}
| no |
+ | long\_type | This description is itself markdown.object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
}) | {
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
} | no |
+ | map-1 | It's map number one. | `map` | {
"a": 1,
"b": 2,
"c": 3
} | no |
| map-2 | It's map number two. | `map` | n/a | yes |
| map-3 | n/a | `map` | `{}` | no |
| no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE\_WITH\_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` | no |
diff --git a/docs/formats/pretty.md b/docs/formats/pretty.md
index 525e78c..6286929 100644
--- a/docs/formats/pretty.md
+++ b/docs/formats/pretty.md
@@ -54,6 +54,9 @@ generates the following output:
}
```
+ Here is some trailing text after code block,
+ followed by another line of text.
+
provider.aws (>= 2.15.0)
diff --git a/examples/main.tf b/examples/main.tf
index f91af75..bab37be 100644
--- a/examples/main.tf
+++ b/examples/main.tf
@@ -19,6 +19,9 @@
* }
* }
* ```
+ *
+ * Here is some trailing text after code block,
+ * followed by another line of text.
*/
resource "tls_private_key" "baz" {}
diff --git a/internal/pkg/print/json/testdata/json-EscapeCharacters.golden b/internal/pkg/print/json/testdata/json-EscapeCharacters.golden
index f3f1585..ee84412 100644
--- a/internal/pkg/print/json/testdata/json-EscapeCharacters.golden
+++ b/internal/pkg/print/json/testdata/json-EscapeCharacters.golden
@@ -1,5 +1,5 @@
{
- "header": "Usage:\n\nExample of 'foo_bar' module in `foo_bar.tf`.\n\n```hcl\nmodule \"foo_bar\" {\n source = \"github.com/foo/bar\"\n\n id = \"1234567890\"\n name = \"baz\"\n\n zones = [\"us-east-1\", \"us-west-1\"]\n\n tags = {\n Name = \"baz\"\n Created-By = \"first.last@email.com\"\n Date-Created = \"20180101\"\n }\n}\n```",
+ "header": "Usage:\n\nExample of 'foo_bar' module in `foo_bar.tf`.\n\n```hcl\nmodule \"foo_bar\" {\n source = \"github.com/foo/bar\"\n\n id = \"1234567890\"\n name = \"baz\"\n\n zones = [\"us-east-1\", \"us-west-1\"]\n\n tags = {\n Name = \"baz\"\n Created-By = \"first.last@email.com\"\n Date-Created = \"20180101\"\n }\n}\n```\n\nHere is some trailing text after code block,\nfollowed by another line of text.",
"inputs": [
{
"name": "unquoted",
diff --git a/internal/pkg/print/json/testdata/json-NoInputs.golden b/internal/pkg/print/json/testdata/json-NoInputs.golden
index db2d2b0..5a2f98d 100644
--- a/internal/pkg/print/json/testdata/json-NoInputs.golden
+++ b/internal/pkg/print/json/testdata/json-NoInputs.golden
@@ -1,5 +1,5 @@
{
- "header": "Usage:\n\nExample of 'foo_bar' module in `foo_bar.tf`.\n\n```hcl\nmodule \"foo_bar\" {\n source = \"github.com/foo/bar\"\n\n id = \"1234567890\"\n name = \"baz\"\n\n zones = [\"us-east-1\", \"us-west-1\"]\n\n tags = {\n Name = \"baz\"\n Created-By = \"first.last@email.com\"\n Date-Created = \"20180101\"\n }\n}\n```",
+ "header": "Usage:\n\nExample of 'foo_bar' module in `foo_bar.tf`.\n\n```hcl\nmodule \"foo_bar\" {\n source = \"github.com/foo/bar\"\n\n id = \"1234567890\"\n name = \"baz\"\n\n zones = [\"us-east-1\", \"us-west-1\"]\n\n tags = {\n Name = \"baz\"\n Created-By = \"first.last@email.com\"\n Date-Created = \"20180101\"\n }\n}\n```\n\nHere is some trailing text after code block,\nfollowed by another line of text.",
"inputs": [],
"outputs": [
{
diff --git a/internal/pkg/print/json/testdata/json-NoOutputs.golden b/internal/pkg/print/json/testdata/json-NoOutputs.golden
index b43f381..a64d8d0 100644
--- a/internal/pkg/print/json/testdata/json-NoOutputs.golden
+++ b/internal/pkg/print/json/testdata/json-NoOutputs.golden
@@ -1,5 +1,5 @@
{
- "header": "Usage:\n\nExample of 'foo_bar' module in `foo_bar.tf`.\n\n```hcl\nmodule \"foo_bar\" {\n source = \"github.com/foo/bar\"\n\n id = \"1234567890\"\n name = \"baz\"\n\n zones = [\"us-east-1\", \"us-west-1\"]\n\n tags = {\n Name = \"baz\"\n Created-By = \"first.last@email.com\"\n Date-Created = \"20180101\"\n }\n}\n```",
+ "header": "Usage:\n\nExample of 'foo_bar' module in `foo_bar.tf`.\n\n```hcl\nmodule \"foo_bar\" {\n source = \"github.com/foo/bar\"\n\n id = \"1234567890\"\n name = \"baz\"\n\n zones = [\"us-east-1\", \"us-west-1\"]\n\n tags = {\n Name = \"baz\"\n Created-By = \"first.last@email.com\"\n Date-Created = \"20180101\"\n }\n}\n```\n\nHere is some trailing text after code block,\nfollowed by another line of text.",
"inputs": [
{
"name": "unquoted",
diff --git a/internal/pkg/print/json/testdata/json-NoProviders.golden b/internal/pkg/print/json/testdata/json-NoProviders.golden
index 18dc897..bfe0c97 100644
--- a/internal/pkg/print/json/testdata/json-NoProviders.golden
+++ b/internal/pkg/print/json/testdata/json-NoProviders.golden
@@ -1,5 +1,5 @@
{
- "header": "Usage:\n\nExample of 'foo_bar' module in `foo_bar.tf`.\n\n```hcl\nmodule \"foo_bar\" {\n source = \"github.com/foo/bar\"\n\n id = \"1234567890\"\n name = \"baz\"\n\n zones = [\"us-east-1\", \"us-west-1\"]\n\n tags = {\n Name = \"baz\"\n Created-By = \"first.last@email.com\"\n Date-Created = \"20180101\"\n }\n}\n```",
+ "header": "Usage:\n\nExample of 'foo_bar' module in `foo_bar.tf`.\n\n```hcl\nmodule \"foo_bar\" {\n source = \"github.com/foo/bar\"\n\n id = \"1234567890\"\n name = \"baz\"\n\n zones = [\"us-east-1\", \"us-west-1\"]\n\n tags = {\n Name = \"baz\"\n Created-By = \"first.last@email.com\"\n Date-Created = \"20180101\"\n }\n}\n```\n\nHere is some trailing text after code block,\nfollowed by another line of text.",
"inputs": [
{
"name": "unquoted",
diff --git a/internal/pkg/print/json/testdata/json-OnlyHeader.golden b/internal/pkg/print/json/testdata/json-OnlyHeader.golden
index 0d02077..1680173 100644
--- a/internal/pkg/print/json/testdata/json-OnlyHeader.golden
+++ b/internal/pkg/print/json/testdata/json-OnlyHeader.golden
@@ -1,5 +1,5 @@
{
- "header": "Usage:\n\nExample of 'foo_bar' module in `foo_bar.tf`.\n\n```hcl\nmodule \"foo_bar\" {\n source = \"github.com/foo/bar\"\n\n id = \"1234567890\"\n name = \"baz\"\n\n zones = [\"us-east-1\", \"us-west-1\"]\n\n tags = {\n Name = \"baz\"\n Created-By = \"first.last@email.com\"\n Date-Created = \"20180101\"\n }\n}\n```",
+ "header": "Usage:\n\nExample of 'foo_bar' module in `foo_bar.tf`.\n\n```hcl\nmodule \"foo_bar\" {\n source = \"github.com/foo/bar\"\n\n id = \"1234567890\"\n name = \"baz\"\n\n zones = [\"us-east-1\", \"us-west-1\"]\n\n tags = {\n Name = \"baz\"\n Created-By = \"first.last@email.com\"\n Date-Created = \"20180101\"\n }\n}\n```\n\nHere is some trailing text after code block,\nfollowed by another line of text.",
"inputs": [],
"outputs": [],
"providers": []
diff --git a/internal/pkg/print/json/testdata/json-SortByName.golden b/internal/pkg/print/json/testdata/json-SortByName.golden
index 01f54a4..54748bd 100644
--- a/internal/pkg/print/json/testdata/json-SortByName.golden
+++ b/internal/pkg/print/json/testdata/json-SortByName.golden
@@ -1,5 +1,5 @@
{
- "header": "Usage:\n\nExample of 'foo_bar' module in `foo_bar.tf`.\n\n```hcl\nmodule \"foo_bar\" {\n source = \"github.com/foo/bar\"\n\n id = \"1234567890\"\n name = \"baz\"\n\n zones = [\"us-east-1\", \"us-west-1\"]\n\n tags = {\n Name = \"baz\"\n Created-By = \"first.last@email.com\"\n Date-Created = \"20180101\"\n }\n}\n```",
+ "header": "Usage:\n\nExample of 'foo_bar' module in `foo_bar.tf`.\n\n```hcl\nmodule \"foo_bar\" {\n source = \"github.com/foo/bar\"\n\n id = \"1234567890\"\n name = \"baz\"\n\n zones = [\"us-east-1\", \"us-west-1\"]\n\n tags = {\n Name = \"baz\"\n Created-By = \"first.last@email.com\"\n Date-Created = \"20180101\"\n }\n}\n```\n\nHere is some trailing text after code block,\nfollowed by another line of text.",
"inputs": [
{
"name": "input-with-code-block",
diff --git a/internal/pkg/print/json/testdata/json-SortByRequired.golden b/internal/pkg/print/json/testdata/json-SortByRequired.golden
index b02cf32..e5fd868 100644
--- a/internal/pkg/print/json/testdata/json-SortByRequired.golden
+++ b/internal/pkg/print/json/testdata/json-SortByRequired.golden
@@ -1,5 +1,5 @@
{
- "header": "Usage:\n\nExample of 'foo_bar' module in `foo_bar.tf`.\n\n```hcl\nmodule \"foo_bar\" {\n source = \"github.com/foo/bar\"\n\n id = \"1234567890\"\n name = \"baz\"\n\n zones = [\"us-east-1\", \"us-west-1\"]\n\n tags = {\n Name = \"baz\"\n Created-By = \"first.last@email.com\"\n Date-Created = \"20180101\"\n }\n}\n```",
+ "header": "Usage:\n\nExample of 'foo_bar' module in `foo_bar.tf`.\n\n```hcl\nmodule \"foo_bar\" {\n source = \"github.com/foo/bar\"\n\n id = \"1234567890\"\n name = \"baz\"\n\n zones = [\"us-east-1\", \"us-west-1\"]\n\n tags = {\n Name = \"baz\"\n Created-By = \"first.last@email.com\"\n Date-Created = \"20180101\"\n }\n}\n```\n\nHere is some trailing text after code block,\nfollowed by another line of text.",
"inputs": [
{
"name": "input_with_underscores",
diff --git a/internal/pkg/print/json/testdata/json.golden b/internal/pkg/print/json/testdata/json.golden
index 6014050..d5e58c5 100644
--- a/internal/pkg/print/json/testdata/json.golden
+++ b/internal/pkg/print/json/testdata/json.golden
@@ -1,5 +1,5 @@
{
- "header": "Usage:\n\nExample of 'foo_bar' module in `foo_bar.tf`.\n\n```hcl\nmodule \"foo_bar\" {\n source = \"github.com/foo/bar\"\n\n id = \"1234567890\"\n name = \"baz\"\n\n zones = [\"us-east-1\", \"us-west-1\"]\n\n tags = {\n Name = \"baz\"\n Created-By = \"first.last@email.com\"\n Date-Created = \"20180101\"\n }\n}\n```",
+ "header": "Usage:\n\nExample of 'foo_bar' module in `foo_bar.tf`.\n\n```hcl\nmodule \"foo_bar\" {\n source = \"github.com/foo/bar\"\n\n id = \"1234567890\"\n name = \"baz\"\n\n zones = [\"us-east-1\", \"us-west-1\"]\n\n tags = {\n Name = \"baz\"\n Created-By = \"first.last@email.com\"\n Date-Created = \"20180101\"\n }\n}\n```\n\nHere is some trailing text after code block,\nfollowed by another line of text.",
"inputs": [
{
"name": "unquoted",
diff --git a/internal/pkg/print/markdown/document/testdata/document-EscapeCharacters.golden b/internal/pkg/print/markdown/document/testdata/document-EscapeCharacters.golden
index 92acf95..450e89f 100644
--- a/internal/pkg/print/markdown/document/testdata/document-EscapeCharacters.golden
+++ b/internal/pkg/print/markdown/document/testdata/document-EscapeCharacters.golden
@@ -19,6 +19,9 @@ module "foo_bar" {
}
```
+Here is some trailing text after code block,
+followed by another line of text.
+
## Providers
The following providers are used by this module:
@@ -151,7 +154,6 @@ Default: `"v1"`
Description: This is a complicated one. We need a newline.
And an example in a code block
-
```
default = [
"machine rack01:neptune"
diff --git a/internal/pkg/print/markdown/document/testdata/document-IndentationAboveAllowed.golden b/internal/pkg/print/markdown/document/testdata/document-IndentationAboveAllowed.golden
index a9ee0c2..aa7015e 100644
--- a/internal/pkg/print/markdown/document/testdata/document-IndentationAboveAllowed.golden
+++ b/internal/pkg/print/markdown/document/testdata/document-IndentationAboveAllowed.golden
@@ -19,6 +19,9 @@ module "foo_bar" {
}
```
+Here is some trailing text after code block,
+followed by another line of text.
+
## Providers
The following providers are used by this module:
@@ -151,7 +154,6 @@ Default: `"v1"`
Description: This is a complicated one. We need a newline.
And an example in a code block
-
```
default = [
"machine rack01:neptune"
diff --git a/internal/pkg/print/markdown/document/testdata/document-IndentationBellowAllowed.golden b/internal/pkg/print/markdown/document/testdata/document-IndentationBellowAllowed.golden
index a9ee0c2..aa7015e 100644
--- a/internal/pkg/print/markdown/document/testdata/document-IndentationBellowAllowed.golden
+++ b/internal/pkg/print/markdown/document/testdata/document-IndentationBellowAllowed.golden
@@ -19,6 +19,9 @@ module "foo_bar" {
}
```
+Here is some trailing text after code block,
+followed by another line of text.
+
## Providers
The following providers are used by this module:
@@ -151,7 +154,6 @@ Default: `"v1"`
Description: This is a complicated one. We need a newline.
And an example in a code block
-
```
default = [
"machine rack01:neptune"
diff --git a/internal/pkg/print/markdown/document/testdata/document-IndentationOfFour.golden b/internal/pkg/print/markdown/document/testdata/document-IndentationOfFour.golden
index 44b0818..b0a2cc8 100644
--- a/internal/pkg/print/markdown/document/testdata/document-IndentationOfFour.golden
+++ b/internal/pkg/print/markdown/document/testdata/document-IndentationOfFour.golden
@@ -19,6 +19,9 @@ module "foo_bar" {
}
```
+Here is some trailing text after code block,
+followed by another line of text.
+
#### Providers
The following providers are used by this module:
@@ -151,7 +154,6 @@ Default: `"v1"`
Description: This is a complicated one. We need a newline.
And an example in a code block
-
```
default = [
"machine rack01:neptune"
diff --git a/internal/pkg/print/markdown/document/testdata/document-NoHeader.golden b/internal/pkg/print/markdown/document/testdata/document-NoHeader.golden
index 600fbc9..b5d4c43 100644
--- a/internal/pkg/print/markdown/document/testdata/document-NoHeader.golden
+++ b/internal/pkg/print/markdown/document/testdata/document-NoHeader.golden
@@ -130,7 +130,6 @@ Default: `"v1"`
Description: This is a complicated one. We need a newline.
And an example in a code block
-
```
default = [
"machine rack01:neptune"
diff --git a/internal/pkg/print/markdown/document/testdata/document-NoInputs.golden b/internal/pkg/print/markdown/document/testdata/document-NoInputs.golden
index 322c085..5eddde8 100644
--- a/internal/pkg/print/markdown/document/testdata/document-NoInputs.golden
+++ b/internal/pkg/print/markdown/document/testdata/document-NoInputs.golden
@@ -19,6 +19,9 @@ module "foo_bar" {
}
```
+Here is some trailing text after code block,
+followed by another line of text.
+
## Providers
The following providers are used by this module:
diff --git a/internal/pkg/print/markdown/document/testdata/document-NoOutputs.golden b/internal/pkg/print/markdown/document/testdata/document-NoOutputs.golden
index bd66870..417d224 100644
--- a/internal/pkg/print/markdown/document/testdata/document-NoOutputs.golden
+++ b/internal/pkg/print/markdown/document/testdata/document-NoOutputs.golden
@@ -19,6 +19,9 @@ module "foo_bar" {
}
```
+Here is some trailing text after code block,
+followed by another line of text.
+
## Providers
The following providers are used by this module:
@@ -151,7 +154,6 @@ Default: `"v1"`
Description: This is a complicated one. We need a newline.
And an example in a code block
-
```
default = [
"machine rack01:neptune"
diff --git a/internal/pkg/print/markdown/document/testdata/document-NoProviders.golden b/internal/pkg/print/markdown/document/testdata/document-NoProviders.golden
index 5988d48..7b00506 100644
--- a/internal/pkg/print/markdown/document/testdata/document-NoProviders.golden
+++ b/internal/pkg/print/markdown/document/testdata/document-NoProviders.golden
@@ -19,6 +19,9 @@ module "foo_bar" {
}
```
+Here is some trailing text after code block,
+followed by another line of text.
+
## Inputs
The following input variables are supported:
@@ -139,7 +142,6 @@ Default: `"v1"`
Description: This is a complicated one. We need a newline.
And an example in a code block
-
```
default = [
"machine rack01:neptune"
diff --git a/internal/pkg/print/markdown/document/testdata/document-OnlyHeader.golden b/internal/pkg/print/markdown/document/testdata/document-OnlyHeader.golden
index 99f8552..af34d6c 100644
--- a/internal/pkg/print/markdown/document/testdata/document-OnlyHeader.golden
+++ b/internal/pkg/print/markdown/document/testdata/document-OnlyHeader.golden
@@ -18,3 +18,6 @@ module "foo_bar" {
}
}
```
+
+Here is some trailing text after code block,
+followed by another line of text.
diff --git a/internal/pkg/print/markdown/document/testdata/document-OnlyInputs.golden b/internal/pkg/print/markdown/document/testdata/document-OnlyInputs.golden
index 4387085..1ecc156 100644
--- a/internal/pkg/print/markdown/document/testdata/document-OnlyInputs.golden
+++ b/internal/pkg/print/markdown/document/testdata/document-OnlyInputs.golden
@@ -118,7 +118,6 @@ Default: `"v1"`
Description: This is a complicated one. We need a newline.
And an example in a code block
-
```
default = [
"machine rack01:neptune"
diff --git a/internal/pkg/print/markdown/document/testdata/document-SortByName.golden b/internal/pkg/print/markdown/document/testdata/document-SortByName.golden
index 4b3bfb1..c428425 100644
--- a/internal/pkg/print/markdown/document/testdata/document-SortByName.golden
+++ b/internal/pkg/print/markdown/document/testdata/document-SortByName.golden
@@ -19,6 +19,9 @@ module "foo_bar" {
}
```
+Here is some trailing text after code block,
+followed by another line of text.
+
## Providers
The following providers are used by this module:
@@ -39,7 +42,6 @@ The following input variables are supported:
Description: This is a complicated one. We need a newline.
And an example in a code block
-
```
default = [
"machine rack01:neptune"
diff --git a/internal/pkg/print/markdown/document/testdata/document-SortByRequired.golden b/internal/pkg/print/markdown/document/testdata/document-SortByRequired.golden
index eea9599..dc3ec92 100644
--- a/internal/pkg/print/markdown/document/testdata/document-SortByRequired.golden
+++ b/internal/pkg/print/markdown/document/testdata/document-SortByRequired.golden
@@ -19,6 +19,9 @@ module "foo_bar" {
}
```
+Here is some trailing text after code block,
+followed by another line of text.
+
## Providers
The following providers are used by this module:
@@ -79,7 +82,6 @@ Default: n/a
Description: This is a complicated one. We need a newline.
And an example in a code block
-
```
default = [
"machine rack01:neptune"
diff --git a/internal/pkg/print/markdown/document/testdata/document-WithRequired.golden b/internal/pkg/print/markdown/document/testdata/document-WithRequired.golden
index 9111f36..7a4c257 100644
--- a/internal/pkg/print/markdown/document/testdata/document-WithRequired.golden
+++ b/internal/pkg/print/markdown/document/testdata/document-WithRequired.golden
@@ -19,6 +19,9 @@ module "foo_bar" {
}
```
+Here is some trailing text after code block,
+followed by another line of text.
+
## Providers
The following providers are used by this module:
@@ -145,7 +148,6 @@ Default: `"v1"`
Description: This is a complicated one. We need a newline.
And an example in a code block
-
```
default = [
"machine rack01:neptune"
diff --git a/internal/pkg/print/markdown/document/testdata/document.golden b/internal/pkg/print/markdown/document/testdata/document.golden
index a9ee0c2..aa7015e 100644
--- a/internal/pkg/print/markdown/document/testdata/document.golden
+++ b/internal/pkg/print/markdown/document/testdata/document.golden
@@ -19,6 +19,9 @@ module "foo_bar" {
}
```
+Here is some trailing text after code block,
+followed by another line of text.
+
## Providers
The following providers are used by this module:
@@ -151,7 +154,6 @@ Default: `"v1"`
Description: This is a complicated one. We need a newline.
And an example in a code block
-
```
default = [
"machine rack01:neptune"
diff --git a/internal/pkg/print/markdown/markdown.go b/internal/pkg/print/markdown/markdown.go
index fb2a7e0..7bd5dea 100644
--- a/internal/pkg/print/markdown/markdown.go
+++ b/internal/pkg/print/markdown/markdown.go
@@ -52,16 +52,19 @@ func SanitizeItemForDocument(s string, settings *print.Settings) string {
}
result := processSegments(
s,
- "\n```",
+ "```",
func(segment string) string {
segment = ConvertMultiLineText(segment, false)
segment = EscapeIllegalCharacters(segment, settings)
segment = NormalizeURLs(segment, settings)
- segment = fmt.Sprintf("%s\n", segment)
return segment
},
func(segment string) string {
- segment = fmt.Sprintf("\n```%s\n```", segment)
+ lastbreak := ""
+ if !strings.HasSuffix(segment, "\n") {
+ lastbreak = "\n"
+ }
+ segment = fmt.Sprintf("```%s%s```", segment, lastbreak)
return segment
},
)
@@ -76,7 +79,7 @@ func SanitizeItemForTable(s string, settings *print.Settings) string {
}
result := processSegments(
s,
- "```\n",
+ "```",
func(segment string) string {
segment = ConvertMultiLineText(segment, true)
segment = EscapeIllegalCharacters(segment, settings)
@@ -84,7 +87,10 @@ func SanitizeItemForTable(s string, settings *print.Settings) string {
return segment
},
func(segment string) string {
- segment = fmt.Sprintf("%s", strings.Replace(strings.Replace(segment, "\n", "
%s", segment) return segment }, ) @@ -92,21 +98,15 @@ func SanitizeItemForTable(s string, settings *print.Settings) string { } // ConvertMultiLineText converts a multi-line text into a suitable Markdown representation. -func ConvertMultiLineText(s string, convertDoubleSpaces bool) string { +func ConvertMultiLineText(s string, isTable bool) string { + if isTable { + s = strings.TrimSpace(s) + } + // Convert double newlines to
{
"a": 1,
"b": 2,
"c": 3
}
|
+| map-1 | It's map number one. | `map` | {
"a": 1,
"b": 2,
"c": 3
} |
| list-3 | n/a | `list` | `[]` |
| list-2 | It's list number two. | `list` | n/a |
-| list-1 | It's list number one. | `list` | [| +| list-1 | It's list number one. | `list` |
"a",
"b",
"c"
]
[| | input\_with\_underscores | A variable with underscores. | `any` | n/a | | input-with-pipe | It includes v1 \| v2 \| v3 | `string` | `"v1"` | -| input-with-code-block | This is a complicated one. We need a newline.
"a",
"b",
"c"
]
default = [| `list` |
"machine rack01:neptune"
]
[| -| long\_type | This description is itself markdown.
"name rack:location"
]
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
| {
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
|
+| input-with-code-block | This is a complicated one. We need a newline.default = [| `list` |
"machine rack01:neptune"
]
[| +| long\_type | This description is itself markdown.
"name rack:location"
]
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
}) | {
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
} |
| no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE\_WITH\_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` |
| with-url | The description contains url. https://www.domain.com/foo/bar_baz.html | `string` | `""` |
diff --git a/internal/pkg/print/markdown/table/testdata/table-IndentationAboveAllowed.golden b/internal/pkg/print/markdown/table/testdata/table-IndentationAboveAllowed.golden
index 2c4ef30..bac20d4 100644
--- a/internal/pkg/print/markdown/table/testdata/table-IndentationAboveAllowed.golden
+++ b/internal/pkg/print/markdown/table/testdata/table-IndentationAboveAllowed.golden
@@ -19,6 +19,9 @@ module "foo_bar" {
}
```
+Here is some trailing text after code block,
+followed by another line of text.
+
## Providers
| Name | Version |
@@ -38,14 +41,14 @@ module "foo_bar" {
| string-1 | It's string number one. | `string` | `"bar"` |
| map-3 | n/a | `map` | `{}` |
| map-2 | It's map number two. | `map` | n/a |
-| map-1 | It's map number one. | `map` | {
"a": 1,
"b": 2,
"c": 3
}
|
+| map-1 | It's map number one. | `map` | {
"a": 1,
"b": 2,
"c": 3
} |
| list-3 | n/a | `list` | `[]` |
| list-2 | It's list number two. | `list` | n/a |
-| list-1 | It's list number one. | `list` | [| +| list-1 | It's list number one. | `list` |
"a",
"b",
"c"
]
[| | input_with_underscores | A variable with underscores. | `any` | n/a | | input-with-pipe | It includes v1 \| v2 \| v3 | `string` | `"v1"` | -| input-with-code-block | This is a complicated one. We need a newline.
"a",
"b",
"c"
]
default = [| `list` |
"machine rack01:neptune"
]
[| -| long_type | This description is itself markdown.
"name rack:location"
]
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
| {
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
|
+| input-with-code-block | This is a complicated one. We need a newline.default = [| `list` |
"machine rack01:neptune"
]
[| +| long_type | This description is itself markdown.
"name rack:location"
]
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
}) | {
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
} |
| no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` |
| with-url | The description contains url. https://www.domain.com/foo/bar_baz.html | `string` | `""` |
diff --git a/internal/pkg/print/markdown/table/testdata/table-IndentationBellowAllowed.golden b/internal/pkg/print/markdown/table/testdata/table-IndentationBellowAllowed.golden
index 2c4ef30..bac20d4 100644
--- a/internal/pkg/print/markdown/table/testdata/table-IndentationBellowAllowed.golden
+++ b/internal/pkg/print/markdown/table/testdata/table-IndentationBellowAllowed.golden
@@ -19,6 +19,9 @@ module "foo_bar" {
}
```
+Here is some trailing text after code block,
+followed by another line of text.
+
## Providers
| Name | Version |
@@ -38,14 +41,14 @@ module "foo_bar" {
| string-1 | It's string number one. | `string` | `"bar"` |
| map-3 | n/a | `map` | `{}` |
| map-2 | It's map number two. | `map` | n/a |
-| map-1 | It's map number one. | `map` | {
"a": 1,
"b": 2,
"c": 3
}
|
+| map-1 | It's map number one. | `map` | {
"a": 1,
"b": 2,
"c": 3
} |
| list-3 | n/a | `list` | `[]` |
| list-2 | It's list number two. | `list` | n/a |
-| list-1 | It's list number one. | `list` | [| +| list-1 | It's list number one. | `list` |
"a",
"b",
"c"
]
[| | input_with_underscores | A variable with underscores. | `any` | n/a | | input-with-pipe | It includes v1 \| v2 \| v3 | `string` | `"v1"` | -| input-with-code-block | This is a complicated one. We need a newline.
"a",
"b",
"c"
]
default = [| `list` |
"machine rack01:neptune"
]
[| -| long_type | This description is itself markdown.
"name rack:location"
]
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
| {
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
|
+| input-with-code-block | This is a complicated one. We need a newline.default = [| `list` |
"machine rack01:neptune"
]
[| +| long_type | This description is itself markdown.
"name rack:location"
]
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
}) | {
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
} |
| no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` |
| with-url | The description contains url. https://www.domain.com/foo/bar_baz.html | `string` | `""` |
diff --git a/internal/pkg/print/markdown/table/testdata/table-IndentationOfFour.golden b/internal/pkg/print/markdown/table/testdata/table-IndentationOfFour.golden
index 2138af9..a1ed21b 100644
--- a/internal/pkg/print/markdown/table/testdata/table-IndentationOfFour.golden
+++ b/internal/pkg/print/markdown/table/testdata/table-IndentationOfFour.golden
@@ -19,6 +19,9 @@ module "foo_bar" {
}
```
+Here is some trailing text after code block,
+followed by another line of text.
+
#### Providers
| Name | Version |
@@ -38,14 +41,14 @@ module "foo_bar" {
| string-1 | It's string number one. | `string` | `"bar"` |
| map-3 | n/a | `map` | `{}` |
| map-2 | It's map number two. | `map` | n/a |
-| map-1 | It's map number one. | `map` | {
"a": 1,
"b": 2,
"c": 3
}
|
+| map-1 | It's map number one. | `map` | {
"a": 1,
"b": 2,
"c": 3
} |
| list-3 | n/a | `list` | `[]` |
| list-2 | It's list number two. | `list` | n/a |
-| list-1 | It's list number one. | `list` | [| +| list-1 | It's list number one. | `list` |
"a",
"b",
"c"
]
[| | input_with_underscores | A variable with underscores. | `any` | n/a | | input-with-pipe | It includes v1 \| v2 \| v3 | `string` | `"v1"` | -| input-with-code-block | This is a complicated one. We need a newline.
"a",
"b",
"c"
]
default = [| `list` |
"machine rack01:neptune"
]
[| -| long_type | This description is itself markdown.
"name rack:location"
]
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
| {
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
|
+| input-with-code-block | This is a complicated one. We need a newline.default = [| `list` |
"machine rack01:neptune"
]
[| +| long_type | This description is itself markdown.
"name rack:location"
]
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
}) | {
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
} |
| no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` |
| with-url | The description contains url. https://www.domain.com/foo/bar_baz.html | `string` | `""` |
diff --git a/internal/pkg/print/markdown/table/testdata/table-NoHeader.golden b/internal/pkg/print/markdown/table/testdata/table-NoHeader.golden
index 1933735..b3e335e 100644
--- a/internal/pkg/print/markdown/table/testdata/table-NoHeader.golden
+++ b/internal/pkg/print/markdown/table/testdata/table-NoHeader.golden
@@ -17,14 +17,14 @@
| string-1 | It's string number one. | `string` | `"bar"` |
| map-3 | n/a | `map` | `{}` |
| map-2 | It's map number two. | `map` | n/a |
-| map-1 | It's map number one. | `map` | {
"a": 1,
"b": 2,
"c": 3
}
|
+| map-1 | It's map number one. | `map` | {
"a": 1,
"b": 2,
"c": 3
} |
| list-3 | n/a | `list` | `[]` |
| list-2 | It's list number two. | `list` | n/a |
-| list-1 | It's list number one. | `list` | [| +| list-1 | It's list number one. | `list` |
"a",
"b",
"c"
]
[| | input_with_underscores | A variable with underscores. | `any` | n/a | | input-with-pipe | It includes v1 \| v2 \| v3 | `string` | `"v1"` | -| input-with-code-block | This is a complicated one. We need a newline.
"a",
"b",
"c"
]
default = [| `list` |
"machine rack01:neptune"
]
[| -| long_type | This description is itself markdown.
"name rack:location"
]
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
| {
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
|
+| input-with-code-block | This is a complicated one. We need a newline.default = [| `list` |
"machine rack01:neptune"
]
[| +| long_type | This description is itself markdown.
"name rack:location"
]
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
}) | {
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
} |
| no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` |
| with-url | The description contains url. https://www.domain.com/foo/bar_baz.html | `string` | `""` |
diff --git a/internal/pkg/print/markdown/table/testdata/table-NoInputs.golden b/internal/pkg/print/markdown/table/testdata/table-NoInputs.golden
index 10fca77..dc89b69 100644
--- a/internal/pkg/print/markdown/table/testdata/table-NoInputs.golden
+++ b/internal/pkg/print/markdown/table/testdata/table-NoInputs.golden
@@ -19,6 +19,9 @@ module "foo_bar" {
}
```
+Here is some trailing text after code block,
+followed by another line of text.
+
## Providers
| Name | Version |
diff --git a/internal/pkg/print/markdown/table/testdata/table-NoOutputs.golden b/internal/pkg/print/markdown/table/testdata/table-NoOutputs.golden
index 9a0a19b..fcdb1a9 100644
--- a/internal/pkg/print/markdown/table/testdata/table-NoOutputs.golden
+++ b/internal/pkg/print/markdown/table/testdata/table-NoOutputs.golden
@@ -19,6 +19,9 @@ module "foo_bar" {
}
```
+Here is some trailing text after code block,
+followed by another line of text.
+
## Providers
| Name | Version |
@@ -38,13 +41,13 @@ module "foo_bar" {
| string-1 | It's string number one. | `string` | `"bar"` |
| map-3 | n/a | `map` | `{}` |
| map-2 | It's map number two. | `map` | n/a |
-| map-1 | It's map number one. | `map` | {
"a": 1,
"b": 2,
"c": 3
}
|
+| map-1 | It's map number one. | `map` | {
"a": 1,
"b": 2,
"c": 3
} |
| list-3 | n/a | `list` | `[]` |
| list-2 | It's list number two. | `list` | n/a |
-| list-1 | It's list number one. | `list` | [| +| list-1 | It's list number one. | `list` |
"a",
"b",
"c"
]
[| | input_with_underscores | A variable with underscores. | `any` | n/a | | input-with-pipe | It includes v1 \| v2 \| v3 | `string` | `"v1"` | -| input-with-code-block | This is a complicated one. We need a newline.
"a",
"b",
"c"
]
default = [| `list` |
"machine rack01:neptune"
]
[| -| long_type | This description is itself markdown.
"name rack:location"
]
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
| {
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
|
+| input-with-code-block | This is a complicated one. We need a newline.default = [| `list` |
"machine rack01:neptune"
]
[| +| long_type | This description is itself markdown.
"name rack:location"
]
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
}) | {
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
} |
| no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` |
| with-url | The description contains url. https://www.domain.com/foo/bar_baz.html | `string` | `""` |
diff --git a/internal/pkg/print/markdown/table/testdata/table-NoProviders.golden b/internal/pkg/print/markdown/table/testdata/table-NoProviders.golden
index 53b9e72..1dbb63e 100644
--- a/internal/pkg/print/markdown/table/testdata/table-NoProviders.golden
+++ b/internal/pkg/print/markdown/table/testdata/table-NoProviders.golden
@@ -19,6 +19,9 @@ module "foo_bar" {
}
```
+Here is some trailing text after code block,
+followed by another line of text.
+
## Inputs
| Name | Description | Type | Default |
@@ -29,14 +32,14 @@ module "foo_bar" {
| string-1 | It's string number one. | `string` | `"bar"` |
| map-3 | n/a | `map` | `{}` |
| map-2 | It's map number two. | `map` | n/a |
-| map-1 | It's map number one. | `map` | {
"a": 1,
"b": 2,
"c": 3
}
|
+| map-1 | It's map number one. | `map` | {
"a": 1,
"b": 2,
"c": 3
} |
| list-3 | n/a | `list` | `[]` |
| list-2 | It's list number two. | `list` | n/a |
-| list-1 | It's list number one. | `list` | [| +| list-1 | It's list number one. | `list` |
"a",
"b",
"c"
]
[| | input_with_underscores | A variable with underscores. | `any` | n/a | | input-with-pipe | It includes v1 \| v2 \| v3 | `string` | `"v1"` | -| input-with-code-block | This is a complicated one. We need a newline.
"a",
"b",
"c"
]
default = [| `list` |
"machine rack01:neptune"
]
[| -| long_type | This description is itself markdown.
"name rack:location"
]
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
| {
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
|
+| input-with-code-block | This is a complicated one. We need a newline.default = [| `list` |
"machine rack01:neptune"
]
[| +| long_type | This description is itself markdown.
"name rack:location"
]
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
}) | {
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
} |
| no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` |
| with-url | The description contains url. https://www.domain.com/foo/bar_baz.html | `string` | `""` |
diff --git a/internal/pkg/print/markdown/table/testdata/table-OnlyHeader.golden b/internal/pkg/print/markdown/table/testdata/table-OnlyHeader.golden
index 99f8552..af34d6c 100644
--- a/internal/pkg/print/markdown/table/testdata/table-OnlyHeader.golden
+++ b/internal/pkg/print/markdown/table/testdata/table-OnlyHeader.golden
@@ -18,3 +18,6 @@ module "foo_bar" {
}
}
```
+
+Here is some trailing text after code block,
+followed by another line of text.
diff --git a/internal/pkg/print/markdown/table/testdata/table-OnlyInputs.golden b/internal/pkg/print/markdown/table/testdata/table-OnlyInputs.golden
index 0785342..556aba5 100644
--- a/internal/pkg/print/markdown/table/testdata/table-OnlyInputs.golden
+++ b/internal/pkg/print/markdown/table/testdata/table-OnlyInputs.golden
@@ -8,13 +8,13 @@
| string-1 | It's string number one. | `string` | `"bar"` |
| map-3 | n/a | `map` | `{}` |
| map-2 | It's map number two. | `map` | n/a |
-| map-1 | It's map number one. | `map` | {
"a": 1,
"b": 2,
"c": 3
}
|
+| map-1 | It's map number one. | `map` | {
"a": 1,
"b": 2,
"c": 3
} |
| list-3 | n/a | `list` | `[]` |
| list-2 | It's list number two. | `list` | n/a |
-| list-1 | It's list number one. | `list` | [| +| list-1 | It's list number one. | `list` |
"a",
"b",
"c"
]
[| | input_with_underscores | A variable with underscores. | `any` | n/a | | input-with-pipe | It includes v1 \| v2 \| v3 | `string` | `"v1"` | -| input-with-code-block | This is a complicated one. We need a newline.
"a",
"b",
"c"
]
default = [| `list` |
"machine rack01:neptune"
]
[| -| long_type | This description is itself markdown.
"name rack:location"
]
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
| {
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
|
+| input-with-code-block | This is a complicated one. We need a newline.default = [| `list` |
"machine rack01:neptune"
]
[| +| long_type | This description is itself markdown.
"name rack:location"
]
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
}) | {
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
} |
| no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` |
| with-url | The description contains url. https://www.domain.com/foo/bar_baz.html | `string` | `""` |
diff --git a/internal/pkg/print/markdown/table/testdata/table-SortByName.golden b/internal/pkg/print/markdown/table/testdata/table-SortByName.golden
index 8c6fd99..53df830 100644
--- a/internal/pkg/print/markdown/table/testdata/table-SortByName.golden
+++ b/internal/pkg/print/markdown/table/testdata/table-SortByName.golden
@@ -19,6 +19,9 @@ module "foo_bar" {
}
```
+Here is some trailing text after code block,
+followed by another line of text.
+
## Providers
| Name | Version |
@@ -32,14 +35,14 @@ module "foo_bar" {
| Name | Description | Type | Default |
|------|-------------|------|---------|
-| input-with-code-block | This is a complicated one. We need a newline.default = [| `list` |
"machine rack01:neptune"
]
[| +| input-with-code-block | This is a complicated one. We need a newline.
"name rack:location"
]
default = [| `list` |
"machine rack01:neptune"
]
[| | input-with-pipe | It includes v1 \| v2 \| v3 | `string` | `"v1"` | | input_with_underscores | A variable with underscores. | `any` | n/a | -| list-1 | It's list number one. | `list` |
"name rack:location"
]
[| +| list-1 | It's list number one. | `list` |
"a",
"b",
"c"
]
[| | list-2 | It's list number two. | `list` | n/a | | list-3 | n/a | `list` | `[]` | -| long_type | This description is itself markdown.
"a",
"b",
"c"
]
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
| {
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
|
-| map-1 | It's map number one. | `map` | {
"a": 1,
"b": 2,
"c": 3
}
|
+| long_type | This description is itself markdown.object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
}) | {
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
} |
+| map-1 | It's map number one. | `map` | {
"a": 1,
"b": 2,
"c": 3
} |
| map-2 | It's map number two. | `map` | n/a |
| map-3 | n/a | `map` | `{}` |
| no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` |
diff --git a/internal/pkg/print/markdown/table/testdata/table-SortByRequired.golden b/internal/pkg/print/markdown/table/testdata/table-SortByRequired.golden
index 6ae6d95..2f3c311 100644
--- a/internal/pkg/print/markdown/table/testdata/table-SortByRequired.golden
+++ b/internal/pkg/print/markdown/table/testdata/table-SortByRequired.golden
@@ -19,6 +19,9 @@ module "foo_bar" {
}
```
+Here is some trailing text after code block,
+followed by another line of text.
+
## Providers
| Name | Version |
@@ -37,12 +40,12 @@ module "foo_bar" {
| map-2 | It's map number two. | `map` | n/a |
| string-2 | It's string number two. | `string` | n/a |
| unquoted | n/a | `any` | n/a |
-| input-with-code-block | This is a complicated one. We need a newline.default = [| `list` |
"machine rack01:neptune"
]
[| +| input-with-code-block | This is a complicated one. We need a newline.
"name rack:location"
]
default = [| `list` |
"machine rack01:neptune"
]
[| | input-with-pipe | It includes v1 \| v2 \| v3 | `string` | `"v1"` | -| list-1 | It's list number one. | `list` |
"name rack:location"
]
[| +| list-1 | It's list number one. | `list` |
"a",
"b",
"c"
]
[| | list-3 | n/a | `list` | `[]` | -| long_type | This description is itself markdown.
"a",
"b",
"c"
]
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
| {
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
|
-| map-1 | It's map number one. | `map` | {
"a": 1,
"b": 2,
"c": 3
}
|
+| long_type | This description is itself markdown.object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
}) | {
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
} |
+| map-1 | It's map number one. | `map` | {
"a": 1,
"b": 2,
"c": 3
} |
| map-3 | n/a | `map` | `{}` |
| no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` |
| string-1 | It's string number one. | `string` | `"bar"` |
diff --git a/internal/pkg/print/markdown/table/testdata/table-WithRequired.golden b/internal/pkg/print/markdown/table/testdata/table-WithRequired.golden
index 7cdf6e0..fe6be9b 100644
--- a/internal/pkg/print/markdown/table/testdata/table-WithRequired.golden
+++ b/internal/pkg/print/markdown/table/testdata/table-WithRequired.golden
@@ -19,6 +19,9 @@ module "foo_bar" {
}
```
+Here is some trailing text after code block,
+followed by another line of text.
+
## Providers
| Name | Version |
@@ -38,14 +41,14 @@ module "foo_bar" {
| string-1 | It's string number one. | `string` | `"bar"` | no |
| map-3 | n/a | `map` | `{}` | no |
| map-2 | It's map number two. | `map` | n/a | yes |
-| map-1 | It's map number one. | `map` | {
"a": 1,
"b": 2,
"c": 3
}
| no |
+| map-1 | It's map number one. | `map` | {
"a": 1,
"b": 2,
"c": 3
} | no |
| list-3 | n/a | `list` | `[]` | no |
| list-2 | It's list number two. | `list` | n/a | yes |
-| list-1 | It's list number one. | `list` | [| no | +| list-1 | It's list number one. | `list` |
"a",
"b",
"c"
]
[| no | | input_with_underscores | A variable with underscores. | `any` | n/a | yes | | input-with-pipe | It includes v1 \| v2 \| v3 | `string` | `"v1"` | no | -| input-with-code-block | This is a complicated one. We need a newline.
"a",
"b",
"c"
]
default = [| `list` |
"machine rack01:neptune"
]
[| no | -| long_type | This description is itself markdown.
"name rack:location"
]
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
| {
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| no |
+| input-with-code-block | This is a complicated one. We need a newline.default = [| `list` |
"machine rack01:neptune"
]
[| no | +| long_type | This description is itself markdown.
"name rack:location"
]
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
}) | {
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
} | no |
| no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` | no |
| with-url | The description contains url. https://www.domain.com/foo/bar_baz.html | `string` | `""` | no |
diff --git a/internal/pkg/print/markdown/table/testdata/table.golden b/internal/pkg/print/markdown/table/testdata/table.golden
index 2c4ef30..bac20d4 100644
--- a/internal/pkg/print/markdown/table/testdata/table.golden
+++ b/internal/pkg/print/markdown/table/testdata/table.golden
@@ -19,6 +19,9 @@ module "foo_bar" {
}
```
+Here is some trailing text after code block,
+followed by another line of text.
+
## Providers
| Name | Version |
@@ -38,14 +41,14 @@ module "foo_bar" {
| string-1 | It's string number one. | `string` | `"bar"` |
| map-3 | n/a | `map` | `{}` |
| map-2 | It's map number two. | `map` | n/a |
-| map-1 | It's map number one. | `map` | {
"a": 1,
"b": 2,
"c": 3
}
|
+| map-1 | It's map number one. | `map` | {
"a": 1,
"b": 2,
"c": 3
} |
| list-3 | n/a | `list` | `[]` |
| list-2 | It's list number two. | `list` | n/a |
-| list-1 | It's list number one. | `list` | [| +| list-1 | It's list number one. | `list` |
"a",
"b",
"c"
]
[| | input_with_underscores | A variable with underscores. | `any` | n/a | | input-with-pipe | It includes v1 \| v2 \| v3 | `string` | `"v1"` | -| input-with-code-block | This is a complicated one. We need a newline.
"a",
"b",
"c"
]
default = [| `list` |
"machine rack01:neptune"
]
[| -| long_type | This description is itself markdown.
"name rack:location"
]
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
| {
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
|
+| input-with-code-block | This is a complicated one. We need a newline.default = [| `list` |
"machine rack01:neptune"
]
[| +| long_type | This description is itself markdown.
"name rack:location"
]
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
}) | {
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
} |
| no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` |
| with-url | The description contains url. https://www.domain.com/foo/bar_baz.html | `string` | `""` |
diff --git a/internal/pkg/print/pretty/testdata/pretty-NoColor.golden b/internal/pkg/print/pretty/testdata/pretty-NoColor.golden
index 48346c5..ec8ef23 100644
--- a/internal/pkg/print/pretty/testdata/pretty-NoColor.golden
+++ b/internal/pkg/print/pretty/testdata/pretty-NoColor.golden
@@ -21,6 +21,9 @@ module "foo_bar" {
}
```
+Here is some trailing text after code block,
+followed by another line of text.
+
provider.tls
diff --git a/internal/pkg/print/pretty/testdata/pretty-NoInputs.golden b/internal/pkg/print/pretty/testdata/pretty-NoInputs.golden
index 6ef99d7..da3684f 100644
--- a/internal/pkg/print/pretty/testdata/pretty-NoInputs.golden
+++ b/internal/pkg/print/pretty/testdata/pretty-NoInputs.golden
@@ -20,6 +20,9 @@
[90m }[0m
[90m}[0m
[90m```[0m
+[90m[0m
+[90mHere is some trailing text after code block,[0m
+[90mfollowed by another line of text.[0m
diff --git a/internal/pkg/print/pretty/testdata/pretty-NoOutputs.golden b/internal/pkg/print/pretty/testdata/pretty-NoOutputs.golden
index 9af8ad1..be7e153 100644
--- a/internal/pkg/print/pretty/testdata/pretty-NoOutputs.golden
+++ b/internal/pkg/print/pretty/testdata/pretty-NoOutputs.golden
@@ -20,6 +20,9 @@
[90m }[0m
[90m}[0m
[90m```[0m
+[90m[0m
+[90mHere is some trailing text after code block,[0m
+[90mfollowed by another line of text.[0m
diff --git a/internal/pkg/print/pretty/testdata/pretty-NoProviders.golden b/internal/pkg/print/pretty/testdata/pretty-NoProviders.golden
index 4f18cce..6dc3645 100644
--- a/internal/pkg/print/pretty/testdata/pretty-NoProviders.golden
+++ b/internal/pkg/print/pretty/testdata/pretty-NoProviders.golden
@@ -20,6 +20,9 @@
[90m }[0m
[90m}[0m
[90m```[0m
+[90m[0m
+[90mHere is some trailing text after code block,[0m
+[90mfollowed by another line of text.[0m
diff --git a/internal/pkg/print/pretty/testdata/pretty-OnlyHeader.golden b/internal/pkg/print/pretty/testdata/pretty-OnlyHeader.golden
index f1263be..38f7538 100644
--- a/internal/pkg/print/pretty/testdata/pretty-OnlyHeader.golden
+++ b/internal/pkg/print/pretty/testdata/pretty-OnlyHeader.golden
@@ -20,4 +20,7 @@
[90m }[0m
[90m}[0m
[90m```[0m
+[90m[0m
+[90mHere is some trailing text after code block,[0m
+[90mfollowed by another line of text.[0m
diff --git a/internal/pkg/print/pretty/testdata/pretty-SortByName.golden b/internal/pkg/print/pretty/testdata/pretty-SortByName.golden
index 1b0b5b3..dff872f 100644
--- a/internal/pkg/print/pretty/testdata/pretty-SortByName.golden
+++ b/internal/pkg/print/pretty/testdata/pretty-SortByName.golden
@@ -20,6 +20,9 @@
[90m }[0m
[90m}[0m
[90m```[0m
+[90m[0m
+[90mHere is some trailing text after code block,[0m
+[90mfollowed by another line of text.[0m
diff --git a/internal/pkg/print/pretty/testdata/pretty-SortByRequired.golden b/internal/pkg/print/pretty/testdata/pretty-SortByRequired.golden
index dc8d07a..6964b3d 100644
--- a/internal/pkg/print/pretty/testdata/pretty-SortByRequired.golden
+++ b/internal/pkg/print/pretty/testdata/pretty-SortByRequired.golden
@@ -20,6 +20,9 @@
[90m }[0m
[90m}[0m
[90m```[0m
+[90m[0m
+[90mHere is some trailing text after code block,[0m
+[90mfollowed by another line of text.[0m
diff --git a/internal/pkg/print/pretty/testdata/pretty.golden b/internal/pkg/print/pretty/testdata/pretty.golden
index 5ec5ff1..8652ada 100644
--- a/internal/pkg/print/pretty/testdata/pretty.golden
+++ b/internal/pkg/print/pretty/testdata/pretty.golden
@@ -20,6 +20,9 @@
[90m }[0m
[90m}[0m
[90m```[0m
+[90m[0m
+[90mHere is some trailing text after code block,[0m
+[90mfollowed by another line of text.[0m