-
Notifications
You must be signed in to change notification settings - Fork 28
Add HTML escape function #143
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
base: main
Are you sure you want to change the base?
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 <[email protected]>
|
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 [email protected]