martini-contrib / render

Martini middleware/handler for easily rendering serialized JSON, XML, and HTML template responses.
MIT License
245 stars 57 forks source link

Allow render to return proper XHTML valid content type when requested #9

Closed RadioactiveMouse closed 10 years ago

RadioactiveMouse commented 10 years ago

Considering the HTML5 specification allows 2 different content-type headers to be specified[1], I added a patch to allow the user to explicitly specify XHTML (application/xhtml+xml) instead of HTML (text/html).

[1] https://developer.mozilla.org/en/docs/XHTML

codegangsta commented 10 years ago

I like the idea of having this. Look at my note about how to structure this option

RadioactiveMouse commented 10 years ago

I did as you mentioned and changed the options type to HTMLContentType. Instead of adding another field to renderer we can just read the content-type from the options struct embedded in the renderer already.

codegangsta commented 10 years ago

Awesome! Merging