Skip to content

Commit

Permalink
fix: escape text to prevent auto links (2)
Browse files Browse the repository at this point in the history
Simplify the expression and escape links in examples in the Binding YAML
  • Loading branch information
zregvart committed Mar 21, 2022
1 parent 060a195 commit 7ef5a89
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions docs/modules/ROOT/examples/js/kamelets.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function kameletPropertyList (definition) {
Object.entries(definition.properties)
.filter(([name, value]) => definition.required.includes(name))
.sort(([name1, value1], [name2, value2]) => name1.localeCompare(name2))
.map(([name, value]) => [name, value.example ? value.example : `The ${value.title}`])
.map(([name, value]) => [name, value.example ? util.escapeAutoLinks(value.example) : `The ${value.title}`])
)
}

Expand Down Expand Up @@ -162,4 +162,3 @@ const kameletBindings = {
},
}),
}

2 changes: 1 addition & 1 deletion docs/modules/ROOT/examples/template/kamelet-options.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The following table summarizes the configuration options available for the \`{na
| Property| Name| Description| Type| Default| Example
|===

jsonpathTable::example$yaml/${basename}.kamelet.yaml[query='nodes$.spec.definition.properties.*',cellformats='util.boldLink(name)|value.title|util.description(value)|util.valueAsString(value.type)|util.valueAsString(value.default)|util.escapeAutoLinks(util.valueAsString(value.example))',{requires},transform=kamelets.sort]
jsonpathTable::example$yaml/${basename}.kamelet.yaml[query='nodes$.spec.definition.properties.*',cellformats='util.boldLink(name)|value.title|util.description(value)|util.valueAsString(value.type)|util.valueAsString(value.default)|util.escapeAutoLinks(value.example)',{requires},transform=kamelets.sort]

endif::[]

Expand Down

0 comments on commit 7ef5a89

Please sign in to comment.