Skip to content
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

Defaulting to HTML5 causes issues when generating XML #92

Open
virtualfunction opened this issue Feb 16, 2015 · 1 comment
Open

Defaulting to HTML5 causes issues when generating XML #92

virtualfunction opened this issue Feb 16, 2015 · 1 comment

Comments

@virtualfunction
Copy link

lib/haml-rails.rb:13 sets the format to html5 which prevents XML tags from closing. Before usign html-haml I was setting this as an config/initializers/ using:

Haml::Template.options.update \
  attr_wrapper: "'",
  format:       :xhtml, # HTML 5 wrecks RSS/ATOM
  preserve:     [ 'textarea', 'pre' ],
  autoclose:
    %w[ meta img link br hr input area param col base ] +
    %w[ media:content enclosure media:thumbnail atom:link itunes:category ]

Obviously I've wrapped it in a config.config_initialize but this might throw off other users if they are also using HAML for XML / RSS / ATOM files, or at least be clearly documented.

@indirect
Copy link
Member

It's just a default. What's stopping you from setting options[:format] = :xhtml?

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

No branches or pull requests

2 participants