mirror of
https://github.com/terraform-docs/terraform-docs.git
synced 2026-03-27 04:48:33 +07:00
fix: Preserve asterisk list in header and fix escaping (#179)
This commit is contained in:
@@ -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```\n\nHere is some trailing text after code block,\nfollowed by another line of text.",
|
||||
"header": "Usage:\n\nExample of 'foo_bar' module in `foo_bar.tf`.\n\n- list item 1\n- list item 2\n\nEven inline **formatting** in _here_ is possible.\nand some [link](https://domain.com/)\n\n* list item 3\n* list item 4\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",
|
||||
|
||||
@@ -42,6 +42,15 @@ generates the following output:
|
||||
|
||||
Example of 'foo\_bar' module in `foo_bar.tf`.
|
||||
|
||||
- list item 1
|
||||
- list item 2
|
||||
|
||||
Even inline **formatting** in _here_ is possible.
|
||||
and some [link](https://domain.com/)
|
||||
|
||||
* list item 3
|
||||
* list item 4
|
||||
|
||||
```hcl
|
||||
module "foo_bar" {
|
||||
source = "github.com/foo/bar"
|
||||
|
||||
@@ -42,6 +42,15 @@ generates the following output:
|
||||
|
||||
Example of 'foo\_bar' module in `foo_bar.tf`.
|
||||
|
||||
- list item 1
|
||||
- list item 2
|
||||
|
||||
Even inline **formatting** in _here_ is possible.
|
||||
and some [link](https://domain.com/)
|
||||
|
||||
* list item 3
|
||||
* list item 4
|
||||
|
||||
```hcl
|
||||
module "foo_bar" {
|
||||
source = "github.com/foo/bar"
|
||||
|
||||
@@ -37,6 +37,15 @@ generates the following output:
|
||||
|
||||
Example of 'foo_bar' module in `foo_bar.tf`.
|
||||
|
||||
- list item 1
|
||||
- list item 2
|
||||
|
||||
Even inline **formatting** in _here_ is possible.
|
||||
and some [link](https://domain.com/)
|
||||
|
||||
* list item 3
|
||||
* list item 4
|
||||
|
||||
```
|
||||
module "foo_bar" {
|
||||
source = "github.com/foo/bar"
|
||||
|
||||
@@ -3,6 +3,15 @@
|
||||
*
|
||||
* Example of 'foo_bar' module in `foo_bar.tf`.
|
||||
*
|
||||
* - list item 1
|
||||
* - list item 2
|
||||
*
|
||||
* Even inline **formatting** in _here_ is possible.
|
||||
* and some [link](https://domain.com/)
|
||||
*
|
||||
* * list item 3
|
||||
* * list item 4
|
||||
*
|
||||
* ```hcl
|
||||
* module "foo_bar" {
|
||||
* source = "github.com/foo/bar"
|
||||
|
||||
@@ -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```\n\nHere is some trailing text after code block,\nfollowed by another line of text.",
|
||||
"header": "Usage:\n\nExample of 'foo_bar' module in `foo_bar.tf`.\n\n- list item 1\n- list item 2\n\nEven inline **formatting** in _here_ is possible.\nand some [link](https://domain.com/)\n\n* list item 3\n* list item 4\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",
|
||||
|
||||
@@ -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```\n\nHere is some trailing text after code block,\nfollowed by another line of text.",
|
||||
"header": "Usage:\n\nExample of 'foo_bar' module in `foo_bar.tf`.\n\n- list item 1\n- list item 2\n\nEven inline **formatting** in _here_ is possible.\nand some [link](https://domain.com/)\n\n* list item 3\n* list item 4\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": [
|
||||
{
|
||||
|
||||
@@ -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```\n\nHere is some trailing text after code block,\nfollowed by another line of text.",
|
||||
"header": "Usage:\n\nExample of 'foo_bar' module in `foo_bar.tf`.\n\n- list item 1\n- list item 2\n\nEven inline **formatting** in _here_ is possible.\nand some [link](https://domain.com/)\n\n* list item 3\n* list item 4\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",
|
||||
|
||||
@@ -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```\n\nHere is some trailing text after code block,\nfollowed by another line of text.",
|
||||
"header": "Usage:\n\nExample of 'foo_bar' module in `foo_bar.tf`.\n\n- list item 1\n- list item 2\n\nEven inline **formatting** in _here_ is possible.\nand some [link](https://domain.com/)\n\n* list item 3\n* list item 4\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",
|
||||
|
||||
@@ -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```\n\nHere is some trailing text after code block,\nfollowed by another line of text.",
|
||||
"header": "Usage:\n\nExample of 'foo_bar' module in `foo_bar.tf`.\n\n- list item 1\n- list item 2\n\nEven inline **formatting** in _here_ is possible.\nand some [link](https://domain.com/)\n\n* list item 3\n* list item 4\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": []
|
||||
|
||||
@@ -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```\n\nHere is some trailing text after code block,\nfollowed by another line of text.",
|
||||
"header": "Usage:\n\nExample of 'foo_bar' module in `foo_bar.tf`.\n\n- list item 1\n- list item 2\n\nEven inline **formatting** in _here_ is possible.\nand some [link](https://domain.com/)\n\n* list item 3\n* list item 4\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",
|
||||
|
||||
@@ -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```\n\nHere is some trailing text after code block,\nfollowed by another line of text.",
|
||||
"header": "Usage:\n\nExample of 'foo_bar' module in `foo_bar.tf`.\n\n- list item 1\n- list item 2\n\nEven inline **formatting** in _here_ is possible.\nand some [link](https://domain.com/)\n\n* list item 3\n* list item 4\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",
|
||||
|
||||
2
internal/pkg/print/json/testdata/json.golden
vendored
2
internal/pkg/print/json/testdata/json.golden
vendored
@@ -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```\n\nHere is some trailing text after code block,\nfollowed by another line of text.",
|
||||
"header": "Usage:\n\nExample of 'foo_bar' module in `foo_bar.tf`.\n\n- list item 1\n- list item 2\n\nEven inline **formatting** in _here_ is possible.\nand some [link](https://domain.com/)\n\n* list item 3\n* list item 4\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",
|
||||
|
||||
@@ -2,6 +2,15 @@ Usage:
|
||||
|
||||
Example of 'foo\_bar' module in `foo_bar.tf`.
|
||||
|
||||
- list item 1
|
||||
- list item 2
|
||||
|
||||
Even inline **formatting** in _here_ is possible.
|
||||
and some [link](https://domain.com/)
|
||||
|
||||
* list item 3
|
||||
* list item 4
|
||||
|
||||
```hcl
|
||||
module "foo_bar" {
|
||||
source = "github.com/foo/bar"
|
||||
|
||||
@@ -2,6 +2,15 @@ Usage:
|
||||
|
||||
Example of 'foo_bar' module in `foo_bar.tf`.
|
||||
|
||||
- list item 1
|
||||
- list item 2
|
||||
|
||||
Even inline **formatting** in _here_ is possible.
|
||||
and some [link](https://domain.com/)
|
||||
|
||||
* list item 3
|
||||
* list item 4
|
||||
|
||||
```hcl
|
||||
module "foo_bar" {
|
||||
source = "github.com/foo/bar"
|
||||
|
||||
@@ -2,6 +2,15 @@ Usage:
|
||||
|
||||
Example of 'foo_bar' module in `foo_bar.tf`.
|
||||
|
||||
- list item 1
|
||||
- list item 2
|
||||
|
||||
Even inline **formatting** in _here_ is possible.
|
||||
and some [link](https://domain.com/)
|
||||
|
||||
* list item 3
|
||||
* list item 4
|
||||
|
||||
```hcl
|
||||
module "foo_bar" {
|
||||
source = "github.com/foo/bar"
|
||||
|
||||
@@ -2,6 +2,15 @@ Usage:
|
||||
|
||||
Example of 'foo_bar' module in `foo_bar.tf`.
|
||||
|
||||
- list item 1
|
||||
- list item 2
|
||||
|
||||
Even inline **formatting** in _here_ is possible.
|
||||
and some [link](https://domain.com/)
|
||||
|
||||
* list item 3
|
||||
* list item 4
|
||||
|
||||
```hcl
|
||||
module "foo_bar" {
|
||||
source = "github.com/foo/bar"
|
||||
|
||||
@@ -2,6 +2,15 @@ Usage:
|
||||
|
||||
Example of 'foo_bar' module in `foo_bar.tf`.
|
||||
|
||||
- list item 1
|
||||
- list item 2
|
||||
|
||||
Even inline **formatting** in _here_ is possible.
|
||||
and some [link](https://domain.com/)
|
||||
|
||||
* list item 3
|
||||
* list item 4
|
||||
|
||||
```hcl
|
||||
module "foo_bar" {
|
||||
source = "github.com/foo/bar"
|
||||
|
||||
@@ -2,6 +2,15 @@ Usage:
|
||||
|
||||
Example of 'foo_bar' module in `foo_bar.tf`.
|
||||
|
||||
- list item 1
|
||||
- list item 2
|
||||
|
||||
Even inline **formatting** in _here_ is possible.
|
||||
and some [link](https://domain.com/)
|
||||
|
||||
* list item 3
|
||||
* list item 4
|
||||
|
||||
```hcl
|
||||
module "foo_bar" {
|
||||
source = "github.com/foo/bar"
|
||||
|
||||
@@ -2,6 +2,15 @@ Usage:
|
||||
|
||||
Example of 'foo_bar' module in `foo_bar.tf`.
|
||||
|
||||
- list item 1
|
||||
- list item 2
|
||||
|
||||
Even inline **formatting** in _here_ is possible.
|
||||
and some [link](https://domain.com/)
|
||||
|
||||
* list item 3
|
||||
* list item 4
|
||||
|
||||
```hcl
|
||||
module "foo_bar" {
|
||||
source = "github.com/foo/bar"
|
||||
|
||||
@@ -2,6 +2,15 @@ Usage:
|
||||
|
||||
Example of 'foo_bar' module in `foo_bar.tf`.
|
||||
|
||||
- list item 1
|
||||
- list item 2
|
||||
|
||||
Even inline **formatting** in _here_ is possible.
|
||||
and some [link](https://domain.com/)
|
||||
|
||||
* list item 3
|
||||
* list item 4
|
||||
|
||||
```hcl
|
||||
module "foo_bar" {
|
||||
source = "github.com/foo/bar"
|
||||
|
||||
@@ -2,6 +2,15 @@ Usage:
|
||||
|
||||
Example of 'foo_bar' module in `foo_bar.tf`.
|
||||
|
||||
- list item 1
|
||||
- list item 2
|
||||
|
||||
Even inline **formatting** in _here_ is possible.
|
||||
and some [link](https://domain.com/)
|
||||
|
||||
* list item 3
|
||||
* list item 4
|
||||
|
||||
```hcl
|
||||
module "foo_bar" {
|
||||
source = "github.com/foo/bar"
|
||||
|
||||
@@ -2,6 +2,15 @@ Usage:
|
||||
|
||||
Example of 'foo_bar' module in `foo_bar.tf`.
|
||||
|
||||
- list item 1
|
||||
- list item 2
|
||||
|
||||
Even inline **formatting** in _here_ is possible.
|
||||
and some [link](https://domain.com/)
|
||||
|
||||
* list item 3
|
||||
* list item 4
|
||||
|
||||
```hcl
|
||||
module "foo_bar" {
|
||||
source = "github.com/foo/bar"
|
||||
|
||||
@@ -2,6 +2,15 @@ Usage:
|
||||
|
||||
Example of 'foo_bar' module in `foo_bar.tf`.
|
||||
|
||||
- list item 1
|
||||
- list item 2
|
||||
|
||||
Even inline **formatting** in _here_ is possible.
|
||||
and some [link](https://domain.com/)
|
||||
|
||||
* list item 3
|
||||
* list item 4
|
||||
|
||||
```hcl
|
||||
module "foo_bar" {
|
||||
source = "github.com/foo/bar"
|
||||
|
||||
@@ -2,6 +2,15 @@ Usage:
|
||||
|
||||
Example of 'foo_bar' module in `foo_bar.tf`.
|
||||
|
||||
- list item 1
|
||||
- list item 2
|
||||
|
||||
Even inline **formatting** in _here_ is possible.
|
||||
and some [link](https://domain.com/)
|
||||
|
||||
* list item 3
|
||||
* list item 4
|
||||
|
||||
```hcl
|
||||
module "foo_bar" {
|
||||
source = "github.com/foo/bar"
|
||||
|
||||
@@ -127,10 +127,17 @@ func EscapeIllegalCharacters(s string, settings *print.Settings) string {
|
||||
s,
|
||||
"`",
|
||||
func(segment string) string {
|
||||
escape := func(char string) {
|
||||
segment = strings.Replace(segment, char+char, "‡‡", -1)
|
||||
segment = strings.Replace(segment, " "+char, " ‡", -1)
|
||||
segment = strings.Replace(segment, char+" ", "‡ ", -1)
|
||||
segment = strings.Replace(segment, char, "\\"+char, -1)
|
||||
segment = strings.Replace(segment, "‡", char, -1)
|
||||
}
|
||||
// Escape underscore
|
||||
segment = strings.Replace(segment, "_", "\\_", -1)
|
||||
escape("_")
|
||||
// Escape asterisk
|
||||
segment = strings.Replace(segment, "*", "\\*", -1)
|
||||
escape("*")
|
||||
return segment
|
||||
},
|
||||
func(segment string) string {
|
||||
|
||||
@@ -2,6 +2,15 @@ Usage:
|
||||
|
||||
Example of 'foo\_bar' module in `foo_bar.tf`.
|
||||
|
||||
- list item 1
|
||||
- list item 2
|
||||
|
||||
Even inline **formatting** in _here_ is possible.
|
||||
and some [link](https://domain.com/)
|
||||
|
||||
* list item 3
|
||||
* list item 4
|
||||
|
||||
```hcl
|
||||
module "foo_bar" {
|
||||
source = "github.com/foo/bar"
|
||||
|
||||
@@ -2,6 +2,15 @@ Usage:
|
||||
|
||||
Example of 'foo_bar' module in `foo_bar.tf`.
|
||||
|
||||
- list item 1
|
||||
- list item 2
|
||||
|
||||
Even inline **formatting** in _here_ is possible.
|
||||
and some [link](https://domain.com/)
|
||||
|
||||
* list item 3
|
||||
* list item 4
|
||||
|
||||
```hcl
|
||||
module "foo_bar" {
|
||||
source = "github.com/foo/bar"
|
||||
|
||||
@@ -2,6 +2,15 @@ Usage:
|
||||
|
||||
Example of 'foo_bar' module in `foo_bar.tf`.
|
||||
|
||||
- list item 1
|
||||
- list item 2
|
||||
|
||||
Even inline **formatting** in _here_ is possible.
|
||||
and some [link](https://domain.com/)
|
||||
|
||||
* list item 3
|
||||
* list item 4
|
||||
|
||||
```hcl
|
||||
module "foo_bar" {
|
||||
source = "github.com/foo/bar"
|
||||
|
||||
@@ -2,6 +2,15 @@ Usage:
|
||||
|
||||
Example of 'foo_bar' module in `foo_bar.tf`.
|
||||
|
||||
- list item 1
|
||||
- list item 2
|
||||
|
||||
Even inline **formatting** in _here_ is possible.
|
||||
and some [link](https://domain.com/)
|
||||
|
||||
* list item 3
|
||||
* list item 4
|
||||
|
||||
```hcl
|
||||
module "foo_bar" {
|
||||
source = "github.com/foo/bar"
|
||||
|
||||
@@ -2,6 +2,15 @@ Usage:
|
||||
|
||||
Example of 'foo_bar' module in `foo_bar.tf`.
|
||||
|
||||
- list item 1
|
||||
- list item 2
|
||||
|
||||
Even inline **formatting** in _here_ is possible.
|
||||
and some [link](https://domain.com/)
|
||||
|
||||
* list item 3
|
||||
* list item 4
|
||||
|
||||
```hcl
|
||||
module "foo_bar" {
|
||||
source = "github.com/foo/bar"
|
||||
|
||||
@@ -2,6 +2,15 @@ Usage:
|
||||
|
||||
Example of 'foo_bar' module in `foo_bar.tf`.
|
||||
|
||||
- list item 1
|
||||
- list item 2
|
||||
|
||||
Even inline **formatting** in _here_ is possible.
|
||||
and some [link](https://domain.com/)
|
||||
|
||||
* list item 3
|
||||
* list item 4
|
||||
|
||||
```hcl
|
||||
module "foo_bar" {
|
||||
source = "github.com/foo/bar"
|
||||
|
||||
@@ -2,6 +2,15 @@ Usage:
|
||||
|
||||
Example of 'foo_bar' module in `foo_bar.tf`.
|
||||
|
||||
- list item 1
|
||||
- list item 2
|
||||
|
||||
Even inline **formatting** in _here_ is possible.
|
||||
and some [link](https://domain.com/)
|
||||
|
||||
* list item 3
|
||||
* list item 4
|
||||
|
||||
```hcl
|
||||
module "foo_bar" {
|
||||
source = "github.com/foo/bar"
|
||||
|
||||
@@ -2,6 +2,15 @@ Usage:
|
||||
|
||||
Example of 'foo_bar' module in `foo_bar.tf`.
|
||||
|
||||
- list item 1
|
||||
- list item 2
|
||||
|
||||
Even inline **formatting** in _here_ is possible.
|
||||
and some [link](https://domain.com/)
|
||||
|
||||
* list item 3
|
||||
* list item 4
|
||||
|
||||
```hcl
|
||||
module "foo_bar" {
|
||||
source = "github.com/foo/bar"
|
||||
|
||||
@@ -2,6 +2,15 @@ Usage:
|
||||
|
||||
Example of 'foo_bar' module in `foo_bar.tf`.
|
||||
|
||||
- list item 1
|
||||
- list item 2
|
||||
|
||||
Even inline **formatting** in _here_ is possible.
|
||||
and some [link](https://domain.com/)
|
||||
|
||||
* list item 3
|
||||
* list item 4
|
||||
|
||||
```hcl
|
||||
module "foo_bar" {
|
||||
source = "github.com/foo/bar"
|
||||
|
||||
@@ -2,6 +2,15 @@ Usage:
|
||||
|
||||
Example of 'foo_bar' module in `foo_bar.tf`.
|
||||
|
||||
- list item 1
|
||||
- list item 2
|
||||
|
||||
Even inline **formatting** in _here_ is possible.
|
||||
and some [link](https://domain.com/)
|
||||
|
||||
* list item 3
|
||||
* list item 4
|
||||
|
||||
```hcl
|
||||
module "foo_bar" {
|
||||
source = "github.com/foo/bar"
|
||||
|
||||
@@ -2,6 +2,15 @@ Usage:
|
||||
|
||||
Example of 'foo_bar' module in `foo_bar.tf`.
|
||||
|
||||
- list item 1
|
||||
- list item 2
|
||||
|
||||
Even inline **formatting** in _here_ is possible.
|
||||
and some [link](https://domain.com/)
|
||||
|
||||
* list item 3
|
||||
* list item 4
|
||||
|
||||
```hcl
|
||||
module "foo_bar" {
|
||||
source = "github.com/foo/bar"
|
||||
|
||||
@@ -2,6 +2,15 @@ Usage:
|
||||
|
||||
Example of 'foo_bar' module in `foo_bar.tf`.
|
||||
|
||||
- list item 1
|
||||
- list item 2
|
||||
|
||||
Even inline **formatting** in _here_ is possible.
|
||||
and some [link](https://domain.com/)
|
||||
|
||||
* list item 3
|
||||
* list item 4
|
||||
|
||||
```hcl
|
||||
module "foo_bar" {
|
||||
source = "github.com/foo/bar"
|
||||
|
||||
@@ -4,6 +4,15 @@ Usage:
|
||||
|
||||
Example of 'foo_bar' module in `foo_bar.tf`.
|
||||
|
||||
- list item 1
|
||||
- list item 2
|
||||
|
||||
Even inline **formatting** in _here_ is possible.
|
||||
and some [link](https://domain.com/)
|
||||
|
||||
* list item 3
|
||||
* list item 4
|
||||
|
||||
```hcl
|
||||
module "foo_bar" {
|
||||
source = "github.com/foo/bar"
|
||||
|
||||
@@ -4,6 +4,15 @@
|
||||
[90m[0m
|
||||
[90mExample of 'foo_bar' module in `foo_bar.tf`.[0m
|
||||
[90m[0m
|
||||
[90m- list item 1[0m
|
||||
[90m- list item 2[0m
|
||||
[90m[0m
|
||||
[90mEven inline **formatting** in _here_ is possible.[0m
|
||||
[90mand some [link](https://domain.com/)[0m
|
||||
[90m[0m
|
||||
[90m* list item 3[0m
|
||||
[90m* list item 4[0m
|
||||
[90m[0m
|
||||
[90m```hcl[0m
|
||||
[90mmodule "foo_bar" {[0m
|
||||
[90m source = "github.com/foo/bar"[0m
|
||||
|
||||
@@ -4,6 +4,15 @@
|
||||
[90m[0m
|
||||
[90mExample of 'foo_bar' module in `foo_bar.tf`.[0m
|
||||
[90m[0m
|
||||
[90m- list item 1[0m
|
||||
[90m- list item 2[0m
|
||||
[90m[0m
|
||||
[90mEven inline **formatting** in _here_ is possible.[0m
|
||||
[90mand some [link](https://domain.com/)[0m
|
||||
[90m[0m
|
||||
[90m* list item 3[0m
|
||||
[90m* list item 4[0m
|
||||
[90m[0m
|
||||
[90m```hcl[0m
|
||||
[90mmodule "foo_bar" {[0m
|
||||
[90m source = "github.com/foo/bar"[0m
|
||||
|
||||
@@ -4,6 +4,15 @@
|
||||
[90m[0m
|
||||
[90mExample of 'foo_bar' module in `foo_bar.tf`.[0m
|
||||
[90m[0m
|
||||
[90m- list item 1[0m
|
||||
[90m- list item 2[0m
|
||||
[90m[0m
|
||||
[90mEven inline **formatting** in _here_ is possible.[0m
|
||||
[90mand some [link](https://domain.com/)[0m
|
||||
[90m[0m
|
||||
[90m* list item 3[0m
|
||||
[90m* list item 4[0m
|
||||
[90m[0m
|
||||
[90m```hcl[0m
|
||||
[90mmodule "foo_bar" {[0m
|
||||
[90m source = "github.com/foo/bar"[0m
|
||||
|
||||
@@ -4,6 +4,15 @@
|
||||
[90m[0m
|
||||
[90mExample of 'foo_bar' module in `foo_bar.tf`.[0m
|
||||
[90m[0m
|
||||
[90m- list item 1[0m
|
||||
[90m- list item 2[0m
|
||||
[90m[0m
|
||||
[90mEven inline **formatting** in _here_ is possible.[0m
|
||||
[90mand some [link](https://domain.com/)[0m
|
||||
[90m[0m
|
||||
[90m* list item 3[0m
|
||||
[90m* list item 4[0m
|
||||
[90m[0m
|
||||
[90m```hcl[0m
|
||||
[90mmodule "foo_bar" {[0m
|
||||
[90m source = "github.com/foo/bar"[0m
|
||||
|
||||
@@ -4,6 +4,15 @@
|
||||
[90m[0m
|
||||
[90mExample of 'foo_bar' module in `foo_bar.tf`.[0m
|
||||
[90m[0m
|
||||
[90m- list item 1[0m
|
||||
[90m- list item 2[0m
|
||||
[90m[0m
|
||||
[90mEven inline **formatting** in _here_ is possible.[0m
|
||||
[90mand some [link](https://domain.com/)[0m
|
||||
[90m[0m
|
||||
[90m* list item 3[0m
|
||||
[90m* list item 4[0m
|
||||
[90m[0m
|
||||
[90m```hcl[0m
|
||||
[90mmodule "foo_bar" {[0m
|
||||
[90m source = "github.com/foo/bar"[0m
|
||||
|
||||
@@ -4,6 +4,15 @@
|
||||
[90m[0m
|
||||
[90mExample of 'foo_bar' module in `foo_bar.tf`.[0m
|
||||
[90m[0m
|
||||
[90m- list item 1[0m
|
||||
[90m- list item 2[0m
|
||||
[90m[0m
|
||||
[90mEven inline **formatting** in _here_ is possible.[0m
|
||||
[90mand some [link](https://domain.com/)[0m
|
||||
[90m[0m
|
||||
[90m* list item 3[0m
|
||||
[90m* list item 4[0m
|
||||
[90m[0m
|
||||
[90m```hcl[0m
|
||||
[90mmodule "foo_bar" {[0m
|
||||
[90m source = "github.com/foo/bar"[0m
|
||||
|
||||
@@ -4,6 +4,15 @@
|
||||
[90m[0m
|
||||
[90mExample of 'foo_bar' module in `foo_bar.tf`.[0m
|
||||
[90m[0m
|
||||
[90m- list item 1[0m
|
||||
[90m- list item 2[0m
|
||||
[90m[0m
|
||||
[90mEven inline **formatting** in _here_ is possible.[0m
|
||||
[90mand some [link](https://domain.com/)[0m
|
||||
[90m[0m
|
||||
[90m* list item 3[0m
|
||||
[90m* list item 4[0m
|
||||
[90m[0m
|
||||
[90m```hcl[0m
|
||||
[90mmodule "foo_bar" {[0m
|
||||
[90m source = "github.com/foo/bar"[0m
|
||||
|
||||
@@ -26,8 +26,10 @@ func readHeader(path string) string {
|
||||
if strings.HasPrefix(line, "/*") || strings.HasPrefix(line, "*/") {
|
||||
return "", false
|
||||
}
|
||||
if line == "*" {
|
||||
return "", true
|
||||
}
|
||||
line = strings.TrimPrefix(line, "* ")
|
||||
line = strings.TrimPrefix(line, "*")
|
||||
return line, true
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user