kristapsdz / kcgi

minimal CGI and FastCGI library for C/C++
https://kristaps.bsd.lv/kcgi
ISC License
275 stars 40 forks source link

How do I emit css for the STYLE tag without encoding the '>' character #67

Closed ghost closed 5 years ago

ghost commented 5 years ago

I have been using this library for over a year now for a hobby project and I have been very happy with it.

Today I am refactoring my CSS handling and hit a snag - I am trying to put all my CSS in the STYLE tag within the HEAD tag. I just learned about Child Combinators but when I try to use them, the '>' character becomes '>'. I am using khtml_puts() to output the css string after the STYLE tag. Is there a way to emit text without it getting html encoded?

kristapsdz commented 5 years ago

You can directly use the khttp_write family. khtml_write won't output CSS because it's not... HTML. :)

ghost commented 5 years ago

Ahh... that one bypasses the html encoding. Makes sense. Thanks!