8000 Writing raw html from a string · Issue #38 · kaj/ructe · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Writing raw html from a string #38

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

Closed
vivlim opened this issue Oct 22, 2018 · 1 comment · Fixed by #73
Closed

Writing raw html from a string #38

vivlim opened this issue Oct 22, 2018 · 1 comment · Fixed by #73

Comments

@vivlim
Copy link
vivlim commented Oct 22, 2018

I've written some code to declare html form elements & produce html tags in a String. I would have written it in ructe but match isn't supported yet, and I don't know enough Rust yet to add match support to ructe myself.

It would be handy if I could write a string to the document without html entities being escaped. I tried to use the ToHtml trait but that doesn't seem to be exported from the crate...? and I couldn't find any other way to achieve this.

@kaj
Copy link
Owner
kaj commented Oct 25, 2018

Hi!

The Html wrapper (and the ToHtml trait) is public in the generated templates module. See the User.mailto example in examples/simple/src/main.rs line 143 for an example use of it.

Supporting @match in templates, simliar to @if, might be a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0