Add HTML escape function#143
Conversation
|
Hi @eloycoto, thanks for the PR. crdoc/example/crds/example.yaml Line 42 in d082896 The result was Of course, it is not correct HTML. |
|
yeah, works for me: |
|
@eloycoto , from your output I see changes in I changed the fronmatter.tmpl file accordingly, now it works. |
I'm happy to update that, but I think that it's more a corner cases than anything ;-) For me is more have a way to have that function enabled. |
When running yaml files, some data inside the yaml can break the HTML
tables, and there is no way to escape the chars natively.
This commits adds a way to escape variable:
```{{escape .Description}}```
Signed-off-by: Eloy Coto <eloy.coto@acalustra.com>
|
@roytman I don't think that escaping should be in the template as it actually makes sense to use HTML tags in the description (e.g., line breaks). |
|
so you guys think that we need to provide a possibility to escape the special characters, and if somebody wants to do it, he will update the relevant template, correct? |
|
( I'll fix the tests) |
roytman
left a comment
There was a problem hiding this comment.
Hi @eloycoto , sorry for misleading, but we do need unescaped new lines
in some comments.
You were right about a corner case when you suggested defining the escape function only, without updating the templates.
Could you please return to your original commit.
| @@ -1,4 +1,4 @@ | |||
| module fybrik.io/crdoc | |||
| module github.com/eloycoto/crdoc | |||
There was a problem hiding this comment.
please return back the module name
When running yaml files, some data inside the yaml can break the HTML
tables, and there is no way to escape the chars natively.
This commits adds a way to escape variable:
{{escape .Description}}Signed-off-by: Eloy Coto eloy.coto@acalustra.com