Skip to content

feat: santize markdown links #847

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/reference/asciidoc-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ generates the following output:
The following resources are used by this module:

- foo_resource.baz (resource)
- https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource[null_resource.foo] (resource)
- https://registry.terraform.io/providers/hashicorp/tls/latest/docs/resources/private_key[tls_private_key.baz] (resource)
- https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity[aws_caller_identity.current] (data source)
- https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity[aws_caller_identity.ident] (data source)
- [null_resource.foo>](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) (resource)
- [tls_private_key.baz](https://registry.terraform.io/providers/hashicorp/tls/latest/docs/resources/private_key) (resource)
- [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) (data source)
- [aws_caller_identity.ident](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) (data source)

== Required Inputs

Expand Down Expand Up @@ -248,7 +248,7 @@ generates the following output:

=== [[input_input-with-code-block]] <<input_input-with-code-block,input-with-code-block>>

Description: This is a complicated one. We need a newline.
Description: This is a complicated one. We need a newline.
And an example in a code block
```
default = [
Expand Down Expand Up @@ -459,7 +459,7 @@ generates the following output:

=== [[input_with-url]] <<input_with-url,with-url>>

Description: The description contains url. https://www.domain.com/foo/bar_baz.html
Description: The description contains url. <https://www.domain.com/foo/bar_baz.html>

Type: `string`

Expand Down
12 changes: 6 additions & 6 deletions docs/reference/asciidoc-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ generates the following output:
|===
|Name |Type
|foo_resource.baz |resource
|https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource[null_resource.foo] |resource
|https://registry.terraform.io/providers/hashicorp/tls/latest/docs/resources/private_key[tls_private_key.baz] |resource
|https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity[aws_caller_identity.current] |data source
|https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity[aws_caller_identity.ident] |data source
|[null_resource.foo](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) |resource
|[tls_private_key.baz](https://registry.terraform.io/providers/hashicorp/tls/latest/docs/resources/private_key) |resource
|[aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) |data source
|[aws_caller_identity.ident](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) |data source
|===

== Inputs
Expand Down Expand Up @@ -176,7 +176,7 @@ generates the following output:
|no

|[[input_input-with-code-block]] <<input_input-with-code-block,input-with-code-block>>
|This is a complicated one. We need a newline.
|This is a complicated one. We need a newline.
And an example in a code block
[source]
----
Expand Down Expand Up @@ -404,7 +404,7 @@ generates the following output:
|yes

|[[input_with-url]] <<input_with-url,with-url>>
|The description contains url. https://www.domain.com/foo/bar_baz.html
|The description contains url. <https://www.domain.com/foo/bar_baz.html>
|`string`
|`""`
|no
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/json.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ generates the following output:
{
"name": "with-url",
"type": "string",
"description": "The description contains url. https://www.domain.com/foo/bar_baz.html",
"description": "The description contains url. <https://www.domain.com/foo/bar_baz.html>",
"default": "",
"required": false
}
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/markdown-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ generates the following output:

### <a name="input_input-with-code-block"></a> [input-with-code-block](#input\_input-with-code-block)

Description: This is a complicated one. We need a newline.
Description: This is a complicated one. We need a newline.
And an example in a code block
```
default = [
Expand Down Expand Up @@ -461,7 +461,7 @@ generates the following output:

### <a name="input_with-url"></a> [with-url](#input\_with-url)

Description: The description contains url. https://www.domain.com/foo/bar_baz.html
Description: The description contains url. <https://www.domain.com/foo/bar_baz.html>

Type: `string`

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/markdown-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ generates the following output:
| <a name="input_string_default_null"></a> [string\_default\_null](#input\_string\_default\_null) | n/a | `string` | `null` | no |
| <a name="input_string_no_default"></a> [string\_no\_default](#input\_string\_no\_default) | n/a | `string` | n/a | yes |
| <a name="input_unquoted"></a> [unquoted](#input\_unquoted) | n/a | `any` | n/a | yes |
| <a name="input_with-url"></a> [with-url](#input\_with-url) | The description contains url. https://www.domain.com/foo/bar_baz.html | `string` | `""` | no |
| <a name="input_with-url"></a> [with-url](#input\_with-url) | The description contains url. <https://www.domain.com/foo/bar_baz.html> | `string` | `""` | no |

## Outputs

Expand Down
4 changes: 2 additions & 2 deletions docs/reference/pretty.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ generates the following output:
input.input-with-code-block ([
"name rack:location"
])
This is a complicated one. We need a newline.
This is a complicated one. We need a newline.
And an example in a code block
```
default = [
Expand Down Expand Up @@ -245,7 +245,7 @@ generates the following output:
n/a

input.with-url ("")
The description contains url. https://www.domain.com/foo/bar_baz.html
The description contains url. <https://www.domain.com/foo/bar_baz.html>


output.output-0.12
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/toml.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ generates the following output:
[[inputs]]
name = "with-url"
type = "string"
description = "The description contains url. https://www.domain.com/foo/bar_baz.html"
description = "The description contains url. <https://www.domain.com/foo/bar_baz.html>"
default = ""
required = false

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/xml.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ generates the following output:
<input>
<name>with-url</name>
<type>string</type>
<description>The description contains url. https://www.domain.com/foo/bar_baz.html</description>
<description>The description contains url. <https://www.domain.com/foo/bar_baz.html></description>
<default></default>
<required>false</required>
</input>
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/yaml.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ generates the following output:
required: true
- name: with-url
type: string
description: The description contains url. https://www.domain.com/foo/bar_baz.html
description: The description contains url. <https://www.domain.com/foo/bar_baz.html>
default: ""
required: false
modules:
Expand Down
2 changes: 1 addition & 1 deletion format/templates/asciidoc_document_resources.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{{- $isResource := and $.Config.Sections.Resources ( eq "resource" (printf "%s" .GetMode)) }}
{{- $isDataResource := and $.Config.Sections.DataSources ( eq "data source" (printf "%s" .GetMode)) }}
{{- if or $isResource $isDataResource }}
{{- $fullspec := ternary .URL (printf "%s[%s]" .URL .Spec) .Spec }}
{{- $fullspec := ternary .URL (printf "[%s](%s)" .Spec .URL) .Spec }}
- {{ $fullspec }} {{ printf "(%s)" .GetMode -}}
{{- end }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion format/templates/asciidoc_table_resources.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{{- $isResource := and $.Config.Sections.Resources ( eq "resource" (printf "%s" .GetMode)) }}
{{- $isDataResource := and $.Config.Sections.DataSources ( eq "data source" (printf "%s" .GetMode)) }}
{{- if or $isResource $isDataResource }}
{{- $fullspec := ternary .URL (printf "%s[%s]" .URL .Spec) .Spec }}
{{- $fullspec := ternary .URL (printf "[%s](%s)" .Spec .URL) .Spec }}
|{{ $fullspec }} |{{ .GetMode }}
{{- end }}
{{- end }}
Expand Down
10 changes: 5 additions & 5 deletions format/testdata/asciidoc/document-Base.golden
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ Version: v7.8.9
The following resources are used by this module:

- foo_resource.baz (resource)
- https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource[null_resource.foo] (resource)
- https://registry.terraform.io/providers/hashicorp/tls/latest/docs/resources/private_key[tls_private_key.baz] (resource)
- https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity[aws_caller_identity.current] (data source)
- https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity[aws_caller_identity.ident] (data source)
- [null_resource.foo](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) (resource)
- [tls_private_key.baz](https://registry.terraform.io/providers/hashicorp/tls/latest/docs/resources/private_key) (resource)
- [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) (data source)
- [aws_caller_identity.ident](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) (data source)

== Inputs

Expand Down Expand Up @@ -349,7 +349,7 @@ Default: `"VALUE_WITH_UNDERSCORE"`

=== with-url

Description: The description contains url. https://www.domain.com/foo/bar_baz.html
Description: The description contains url. <https://www.domain.com/foo/bar_baz.html>

Type: `string`

Expand Down
10 changes: 5 additions & 5 deletions format/testdata/asciidoc/document-IndentationOfFour.golden
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ Version: v7.8.9
The following resources are used by this module:

- foo_resource.baz (resource)
- https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource[null_resource.foo] (resource)
- https://registry.terraform.io/providers/hashicorp/tls/latest/docs/resources/private_key[tls_private_key.baz] (resource)
- https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity[aws_caller_identity.current] (data source)
- https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity[aws_caller_identity.ident] (data source)
- [null_resource.foo](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) (resource)
- [tls_private_key.baz](https://registry.terraform.io/providers/hashicorp/tls/latest/docs/resources/private_key) (resource)
- [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) (data source)
- [aws_caller_identity.ident](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) (data source)

==== Inputs

Expand Down Expand Up @@ -349,7 +349,7 @@ Default: `"VALUE_WITH_UNDERSCORE"`

===== with-url

Description: The description contains url. https://www.domain.com/foo/bar_baz.html
Description: The description contains url. <https://www.domain.com/foo/bar_baz.html>

Type: `string`

Expand Down
4 changes: 2 additions & 2 deletions format/testdata/asciidoc/document-OnlyDataSources.golden
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

The following resources are used by this module:

- https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity[aws_caller_identity.current] (data source)
- https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity[aws_caller_identity.ident] (data source)
- [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) (data source)
- [aws_caller_identity.ident](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) (data source)
2 changes: 1 addition & 1 deletion format/testdata/asciidoc/document-OnlyInputs.golden
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ Default: `"VALUE_WITH_UNDERSCORE"`

=== with-url

Description: The description contains url. https://www.domain.com/foo/bar_baz.html
Description: The description contains url. <https://www.domain.com/foo/bar_baz.html>

Type: `string`

Expand Down
4 changes: 2 additions & 2 deletions format/testdata/asciidoc/document-OnlyResources.golden
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
The following resources are used by this module:

- foo_resource.baz (resource)
- https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource[null_resource.foo] (resource)
- https://registry.terraform.io/providers/hashicorp/tls/latest/docs/resources/private_key[tls_private_key.baz] (resource)
- [null_resource.foo](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) (resource)
- [tls_private_key.baz](https://registry.terraform.io/providers/hashicorp/tls/latest/docs/resources/private_key) (resource)
10 changes: 5 additions & 5 deletions format/testdata/asciidoc/document-WithAnchor.golden
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ Version: v7.8.9
The following resources are used by this module:

- foo_resource.baz (resource)
- https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource[null_resource.foo] (resource)
- https://registry.terraform.io/providers/hashicorp/tls/latest/docs/resources/private_key[tls_private_key.baz] (resource)
- https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity[aws_caller_identity.current] (data source)
- https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity[aws_caller_identity.ident] (data source)
- [null_resource.foo](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) (resource)
- [tls_private_key.baz](https://registry.terraform.io/providers/hashicorp/tls/latest/docs/resources/private_key) (resource)
- [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) (data source)
- [aws_caller_identity.ident](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) (data source)

== Inputs

Expand Down Expand Up @@ -349,7 +349,7 @@ Default: `"VALUE_WITH_UNDERSCORE"`

=== [[input_with-url]] <<input_with-url,with-url>>

Description: The description contains url. https://www.domain.com/foo/bar_baz.html
Description: The description contains url. <https://www.domain.com/foo/bar_baz.html>

Type: `string`

Expand Down
10 changes: 5 additions & 5 deletions format/testdata/asciidoc/document-WithRequired.golden
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ Version: v7.8.9
The following resources are used by this module:

- foo_resource.baz (resource)
- https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource[null_resource.foo] (resource)
- https://registry.terraform.io/providers/hashicorp/tls/latest/docs/resources/private_key[tls_private_key.baz] (resource)
- https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity[aws_caller_identity.current] (data source)
- https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity[aws_caller_identity.ident] (data source)
- [null_resource.foo](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) (resource)
- [tls_private_key.baz](https://registry.terraform.io/providers/hashicorp/tls/latest/docs/resources/private_key) (resource)
- [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) (data source)
- [aws_caller_identity.ident](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) (data source)

== Required Inputs

Expand Down Expand Up @@ -347,7 +347,7 @@ Default: `"VALUE_WITH_UNDERSCORE"`

=== with-url

Description: The description contains url. https://www.domain.com/foo/bar_baz.html
Description: The description contains url. <https://www.domain.com/foo/bar_baz.html>

Type: `string`

Expand Down
2 changes: 1 addition & 1 deletion format/testdata/asciidoc/document-WithoutDefault.golden
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Type: `string`

=== with-url

Description: The description contains url. https://www.domain.com/foo/bar_baz.html
Description: The description contains url. <https://www.domain.com/foo/bar_baz.html>

Type: `string`

Expand Down
2 changes: 1 addition & 1 deletion format/testdata/asciidoc/document-WithoutType.golden
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ Default: `"VALUE_WITH_UNDERSCORE"`

=== with-url

Description: The description contains url. https://www.domain.com/foo/bar_baz.html
Description: The description contains url. <https://www.domain.com/foo/bar_baz.html>

Default: `""`

Expand Down
10 changes: 5 additions & 5 deletions format/testdata/asciidoc/table-Base.golden
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ followed by another line of text.
|===
|Name |Type
|foo_resource.baz |resource
|https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource[null_resource.foo] |resource
|https://registry.terraform.io/providers/hashicorp/tls/latest/docs/resources/private_key[tls_private_key.baz] |resource
|https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity[aws_caller_identity.current] |data source
|https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity[aws_caller_identity.ident] |data source
|[null_resource.foo](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) |resource
|[tls_private_key.baz](https://registry.terraform.io/providers/hashicorp/tls/latest/docs/resources/private_key) |resource
|[aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) |data source
|[aws_caller_identity.ident](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) |data source
|===

== Inputs
Expand Down Expand Up @@ -271,7 +271,7 @@ object({
|`"VALUE_WITH_UNDERSCORE"`

|with-url
|The description contains url. https://www.domain.com/foo/bar_baz.html
|The description contains url. <https://www.domain.com/foo/bar_baz.html>
|`string`
|`""`

Expand Down
10 changes: 5 additions & 5 deletions format/testdata/asciidoc/table-IndentationOfFour.golden
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ followed by another line of text.
|===
|Name |Type
|foo_resource.baz |resource
|https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource[null_resource.foo] |resource
|https://registry.terraform.io/providers/hashicorp/tls/latest/docs/resources/private_key[tls_private_key.baz] |resource
|https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity[aws_caller_identity.current] |data source
|https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity[aws_caller_identity.ident] |data source
|[null_resource.foo](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) |resource
|[tls_private_key.baz](https://registry.terraform.io/providers/hashicorp/tls/latest/docs/resources/private_key) |resource
|[aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) |data source
|[aws_caller_identity.ident](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) |data source
|===

==== Inputs
Expand Down Expand Up @@ -271,7 +271,7 @@ object({
|`"VALUE_WITH_UNDERSCORE"`

|with-url
|The description contains url. https://www.domain.com/foo/bar_baz.html
|The description contains url. <https://www.domain.com/foo/bar_baz.html>
|`string`
|`""`

Expand Down
4 changes: 2 additions & 2 deletions format/testdata/asciidoc/table-OnlyDataSources.golden
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
[cols="a,a",options="header,autowidth"]
|===
|Name |Type
|https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity[aws_caller_identity.current] |data source
|https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity[aws_caller_identity.ident] |data source
|[aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) |data source
|[aws_caller_identity.ident](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) |data source
|===
2 changes: 1 addition & 1 deletion format/testdata/asciidoc/table-OnlyInputs.golden
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ object({
|`"VALUE_WITH_UNDERSCORE"`

|with-url
|The description contains url. https://www.domain.com/foo/bar_baz.html
|The description contains url. <https://www.domain.com/foo/bar_baz.html>
|`string`
|`""`

Expand Down
Loading