Hi all, Is there any way to make functions like stylesheet_link_tag and image_tag output HTML4 rather then XHTML? (i.e. without the trailing slash in the tags). Both functions are very helpful in keeping the site portable and such, but if they''re making my HTML code invalid I just cannot use them. And no, switching to XHTML is not an option. Thanks for your time, Mathias. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Roderick van Domburg
2006-Nov-20 19:49 UTC
Re: Forcing rails to output HTML4 rather then XHTML?
Mathias Wittlock wrote:> Is there any way to make functions like stylesheet_link_tag and > image_tag output HTML4 rather then XHTML? (i.e. without the trailing > slash in the tags). Both functions are very helpful in keeping the > site portable and such, but if they''re making my HTML code invalid I > just cannot use them.You''ll want to take a look at http://api.rubyonrails.org/classes/ActionView/Helpers/TagHelper.html#M000488. - Roderick -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Mathias Wittlock
2006-Nov-20 20:41 UTC
Re: Forcing rails to output HTML4 rather then XHTML?
On 11/20/06, Roderick van Domburg <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > You''ll want to take a look at > http://api.rubyonrails.org/classes/ActionView/Helpers/TagHelper.html#M000488. > > - RoderickHmm, either I''m missing something or I think you misunderstood my problem. tag() also returns XHTML tags (such as "<br />"). I just want the functionality of image_tag and stylesheet_link_tag, but I want the produced HTML code to end with just ">" and not "/>" (the former being valid HTML 4.01 and the latter valid XHTML 1.0+). I was wondering if there perhaps was some application level setting that would tell Rails that I want HTML 4.01 output rather then XHTML 1.0 from those two functions. Or some undocumented option or something? Thanks for the link though, Mathias. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Roderick van Domburg
2006-Nov-20 20:50 UTC
Re: Forcing rails to output HTML4 rather then XHTML?
Mathias Wittlock wrote:>> You''ll want to take a look at >> http://api.rubyonrails.org/classes/ActionView/Helpers/TagHelper.html#M000488. > > Hmm, either I''m missing something or I think you misunderstood my > problem. tag() also returns XHTML tags (such as "<br />"). I just want > the functionality of image_tag and stylesheet_link_tag, but I want the > produced HTML code to end with just ">" and not "/>" (the former being > valid HTML 4.01 and the latter valid XHTML 1.0+). > > I was wondering if there perhaps was some application level setting > that would tell Rails that I want HTML 4.01 output rather then XHTML > 1.0 from those two functions. Or some undocumented option or > something?If you look at the source, you''ll notice that setting :open => true results in HTML-compliant closing tags. - Roderick -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Deirdre Saoirse Moen
2006-Nov-20 20:51 UTC
Re: Forcing rails to output HTML4 rather then XHTML?
On 11/20/06, Mathias Wittlock <wittlock+rubyonrailslist-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hmm, either I''m missing something or I think you misunderstood my > problem. tag() also returns XHTML tags (such as "<br />"). I just want > the functionality of image_tag and stylesheet_link_tag, but I want the > produced HTML code to end with just ">" and not "/>" (the former being > valid HTML 4.01 and the latter valid XHTML 1.0+). > > I was wondering if there perhaps was some application level setting > that would tell Rails that I want HTML 4.01 output rather then XHTML > 1.0 from those two functions. Or some undocumented option or > something?1) check out rails into vendor/rails. 2) edit the one-liner in tag as pointed out in response to your message. Voila, you have an application-level setting. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Deirdre Saoirse Moen
2006-Nov-20 21:22 UTC
Re: Forcing rails to output HTML4 rather then XHTML?
On 11/20/06, Roderick van Domburg <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > If you look at the source, you''ll notice that setting :open => true > results in HTML-compliant closing tags.Better idea than mine. Must drink coffee before reading list in the morning. -- _Deirdre http://deirdre.net/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Mathias Wittlock
2006-Nov-20 21:27 UTC
Re: Forcing rails to output HTML4 rather then XHTML?
On 11/20/06, Deirdre Saoirse Moen <dsmoen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Voila, you have an application-level setting.Thank you! Sometimes you just need someone to put up that big yellow arrow for you to find what''s really right in front of you. That worked like a charm! Thanks a bunch! You too Roderick! Mathias. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Mathias Wittlock
2006-Nov-20 21:45 UTC
Re: Forcing rails to output HTML4 rather then XHTML?
On 11/20/06, Deirdre Saoirse Moen <dsmoen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > On 11/20/06, Roderick van Domburg <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > > > > If you look at the source, you''ll notice that setting :open => true > > results in HTML-compliant closing tags. > > Better idea than mine. Must drink coffee before reading list in the morning. > > -- > _Deirdre http://deirdre.net/I tried that one first but I didn''t see how I could pass the :open => true bit through stylesheet_link_tag, but I''m starting to think I could use some coffee too (but it''s evening here ;). I''m a bit rusty as well... Mathias. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Rimantas Liubertas
2006-Nov-20 23:48 UTC
Re: Forcing rails to output HTML4 rather then XHTML?
> I tried that one first but I didn''t see how I could pass the :open => > true bit through stylesheet_link_tag, but I''m starting to think I > could use some coffee too (but it''s evening here ;). I''m a bit rusty > as well...Last time I checked there was no simple, unhacky way... Which is sad. Knowing thing or two about HTML and XHTML I am firmly in HTML4.01 Strict camp and that I miss is one-line configuration option ir environemnt.rb: config.html_mode :html | :xhtml... -- Regards, Rimantas -- http://rimantas.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I realize that this is an old thread, but for anyone looking, here''s the solution I just used. in application_helper.rb def stylesheet_link_tag_html4( _n ) return stylesheet_link_tag( _n ).gsub( '' />'', ''>'' ) end Not exactly elegant, but minimally-invasive and easy to understand. It spares you from having to edit your checked out version of rails (as mentioned above), which you might upgrade at some point. Trevor On 11/20/06, Rimantas Liubertas <rimantas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > > I tried that one first but I didn''t see how I could pass the :open => > > true bit through stylesheet_link_tag, but I''m starting to think I > > could use some coffee too (but it''s evening here ;). I''m a bit rusty > > as well... > > Last time I checked there was no simple, unhacky way... Which is sad. > Knowing thing or two about HTML and XHTML I am firmly in HTML4.01 Strict > camp > and that I miss is one-line configuration option ir environemnt.rb: > config.html_mode :html | :xhtml... > > -- > Regards, > Rimantas > -- > http://rimantas.com/ > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Mathias Wittlock
2007-Jan-29 09:37 UTC
Re: Forcing rails to output HTML4 rather then XHTML?
On 1/16/07, Trevor Stow <trevorstow-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I realize that this is an old thread, but for anyone looking, here''s the > solution I just used. > > in application_helper.rb > > def stylesheet_link_tag_html4( _n ) > return stylesheet_link_tag( _n ).gsub( '' />'', ''>'' ) > end > > Not exactly elegant, but minimally-invasive and easy to understand. > It spares you from having to edit your checked out version of rails (as > mentioned above), which you might upgrade at some point. > > TrevorHi Trevor, I almost missed out on your reply there. Even though it''s a bit "hack-y" it still beats having to freeze Rails and do the change there. Could you perhaps briefly explain exactly what you''re doing? I understand the gsub bit, but exactly how does this tie into Rails'' methods? Might be useful both in case I need to "patch" something later and also to do a similar fix for image_tag which also outputs XHTML by default. Thanks for the tip though, Mathias. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Neil Stockbridge
2010-Oct-22 20:37 UTC
Re: Forcing rails to output HTML4 rather then XHTML?
If you want to make _html4 versions of many helpers then this might help: module ApplicationHelper class << self # Supports making alternative versions of Rails helpers that output HTML # 4.01 markup as opposed to XHTML. Example: # # html4_version_of :submit_tag # # ..which creates a submit_tag_html4 helper that takes the same options as # submit_tag but which renders HTML 4.01. # def html4_version_of helper_name define_method "#{helper_name}_html4" do |*args| html = send helper_name, *args html.gsub! " />", ">" html end end def html4_versions_of *helper_names helper_names.each do |helper_name| html4_version_of helper_name end end end html4_versions_of :stylesheet_link_tag, :image_tag, :text_field, :submit_tag end -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Mathias Wittlock wrote in post #170114:> Is there any way to make functions like stylesheet_link_tag and > image_tag output HTML4 rather then XHTML? (i.e. without the trailing > slash in the tags). Both functions are very helpful in keeping the > site portable and such, but if they''re making my HTML code invalid I > just cannot use them.This is definitely something that needs to be resolved for Rails (if it''s not already and I just don''t know about it). However, I say this not for HTML 4 compliance. I couldn''t care less about HTML 4. I left that in the dust quite a while back. I say this because I want HTML 5 compliance. HTML 5 will officially support both HTML and XHTML formats. Rails needs to be configureable to work with either IMHO. I have no idea how difficult of a proposition that is though. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Robert Walker wrote in post #956422:> However, I say this not for HTML 4 compliance. I couldn''t care less > about HTML 4. I left that in the dust quite a while back. I say this > because I want HTML 5 compliance. HTML 5 will officially support both > HTML and XHTML formats. Rails needs to be configureable to work with > either IMHO.Actually, on second thought I think that HTML 5 validates with either <br /> or <br> when using HTML format. The short tag format would, of course, be necessary in the XHTML format since it must validate as XML. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Walter Lee Davis
2010-Oct-22 21:31 UTC
Re: Re: Forcing rails to output HTML4 rather then XHTML?
Rails 3 (last time I fooled with it, which was pre-release) shipped with a completely HTML5 scaffold system, encouraging you to write your own bits in HTML5 as well. Walter On Oct 22, 2010, at 5:08 PM, Robert Walker wrote:> Mathias Wittlock wrote in post #170114: >> Is there any way to make functions like stylesheet_link_tag and >> image_tag output HTML4 rather then XHTML? (i.e. without the trailing >> slash in the tags). Both functions are very helpful in keeping the >> site portable and such, but if they''re making my HTML code invalid I >> just cannot use them. > > This is definitely something that needs to be resolved for Rails (if > it''s not already and I just don''t know about it). > > However, I say this not for HTML 4 compliance. I couldn''t care less > about HTML 4. I left that in the dust quite a while back. I say this > because I want HTML 5 compliance. HTML 5 will officially support both > HTML and XHTML formats. Rails needs to be configureable to work with > either IMHO. > > I have no idea how difficult of a proposition that is though. > > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google > Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails- > talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > . > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en > . >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Robert Walker
2010-Oct-22 21:39 UTC
Re: Re: Forcing rails to output HTML4 rather then XHTML?
Walter Davis wrote in post #956434:> Rails 3 (last time I fooled with it, which was pre-release) shipped > with a completely HTML5 scaffold system, encouraging you to write your > own bits in HTML5 as well.Yes, Item #6 below confirms my earlier thoughts about the optional self-closing tags. Start tags must have the following format: 1. The first character of a start tag must be a U+003C LESS-THAN SIGN character (<). 2. The next few characters of a start tag must be the element''s tag name. 3. If there are to be any attributes in the next step, there must first be one or more space characters. 4. Then, the start tag may have a number of attributes, the syntax for which is described below. Attributes may be separated from each other by one or more space characters. 5. After the attributes, or after the tag name if there are no attributes, there may be one or more space characters. (Some attributes are required to be followed by a space. See the attributes section below.) 6. Then, if the element is one of the void elements, or if the element is a foreign element, then there may be a single U+002F SOLIDUS character (/). This character has no effect on void elements, but on foreign elements it marks the start tag as self-closing. 7. Finally, start tags must be closed by a U+003E GREATER-THAN SIGN character (>). -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2010-Oct-23 01:08 UTC
Re: Forcing rails to output HTML4 rather then XHTML?
Robert Walker wrote in post #956422:> Mathias Wittlock wrote in post #170114: >> Is there any way to make functions like stylesheet_link_tag and >> image_tag output HTML4 rather then XHTML? (i.e. without the trailing >> slash in the tags). Both functions are very helpful in keeping the >> site portable and such, but if they''re making my HTML code invalid I >> just cannot use them. > > This is definitely something that needs to be resolved for Rails (if > it''s not already and I just don''t know about it).It''s been resolved for years. Try the html_output plugin.> > However, I say this not for HTML 4 compliance. I couldn''t care less > about HTML 4. I left that in the dust quite a while back.Why? I thought it was the best format to use for older browsers that don''t know from HTML 5. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser wrote in post #956459:> Why? I thought it was the best format to use for older browsers that > don''t know from HTML 5.Only because I don''t have any sites build in Rails that I care about supporting older browser. I use HTML 5 markup and do my best to make it work well for all reasonably modern browsers. If the sites I currently have look bad for someone visiting with with older browsers I really don''t care. If I were building commercial sites where it actually mattered then I might care more. I don''t think it''s such as bad thing to not perfectly support older browsers. The sooner we can get people to stop using them the better off we are. I am quite aware that not everyone is in a position to be able to do this, but thankfully for my sites it''s not a major concern. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2010-Oct-25 13:34 UTC
Re: Forcing rails to output HTML4 rather then XHTML?
Robert Walker wrote in post #956772: [...]> I don''t think it''s such as bad thing to not perfectly support older > browsers.Not perfectly, perhaps, but as well as possible. I am not sure that providing HTML 5 markup meets that goal. However, I haven''t yet done much research about older browsers'' support of HTML 5.> The sooner we can get people to stop using them the better off > we are.That''s true, but kind of beside the point.> I am quite aware that not everyone is in a position to be able > to do this,Exactly.> but thankfully for my sites it''s not a major concern.How could it ever not be one? Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Peter De Berdt
2010-Oct-25 13:58 UTC
Re: Re: Forcing rails to output HTML4 rather then XHTML?
On 25 Oct 2010, at 15:34, Marnen Laibow-Koser wrote:>> I don''t think it''s such as bad thing to not perfectly support older >> browsers. > > Not perfectly, perhaps, but as well as possible. I am not sure that > providing HTML 5 markup meets that goal. However, I haven''t yet done > much research about older browsers'' support of HTML 5.I think the poster meant something like: I use some of the newer CSS features and maybe some HTML5 attributes. Older browsers will simply ignore those and move on. Trying to get the same result across all browsers and versions is not necessary anyway. If you use IE6, you accept that you might miss out on some of the new goodies. As long as the page renders and is usable, that''s fine imo. Best regards Peter De Berdt -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2010-Oct-25 15:34 UTC
Re: Re: Forcing rails to output HTML4 rather then XHTML?
Peter De Berdt wrote in post #956885:> On 25 Oct 2010, at 15:34, Marnen Laibow-Koser wrote: > >>> I don''t think it''s such as bad thing to not perfectly support older >>> browsers. >> >> Not perfectly, perhaps, but as well as possible. I am not sure that >> providing HTML 5 markup meets that goal. However, I haven''t yet done >> much research about older browsers'' support of HTML 5. > > I think the poster meant something like: I use some of the newer CSS > features and maybe some HTML5 attributes. Older browsers will simply > ignore those and move on....or not. Yes, of course it''s fine to use new attributes that older browsers will ignore. However, HTML 5 differs from HTML 4 not just in its repertoire of attributes and elements, but also *in its basic syntax* -- HTML 5 is no longer a subset of SGML as HTML ≤4 is. That''s the part that (potentially) breaks graceful degradation.> Trying to get the same result across all > browsers and versions is not necessary anyway. If you use IE6, you > accept that you might miss out on some of the new goodies. As long as > the page renders and is usable, that''s fine imo.Right. But when the syntax -- not just the semantics -- changes, then I start worrying. Time for me to do more research.> > > Best regards > > Peter De BerdtBest, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Robert Walker
2010-Oct-25 21:39 UTC
Re: Re: Forcing rails to output HTML4 rather then XHTML?
Marnen Laibow-Koser wrote in post #956924:> Right. But when the syntax -- not just the semantics -- changes, then I > start worrying. Time for me to do more research.Okay, so let''s talk specifics. Assuming valid HTML 5 markup with no HTML 5 specific features, what breaks on what browsers. Is this speculation that things might break on older browsers? Or does anyone have concrete examples for certain browsers and versions? For example, does anyone know if the use of self closing tags (e.g. <br />) actually breaks any of the reasonably modern browsers (i.e. IE 6.0+), of course assuming validating HTML 5 markup? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Peter De Berdt
2010-Oct-26 07:47 UTC
Re: Re: Re: Forcing rails to output HTML4 rather then XHTML?
On 25 Oct 2010, at 17:34, Marnen Laibow-Koser wrote:>>> Not perfectly, perhaps, but as well as possible. I am not sure that >>> providing HTML 5 markup meets that goal. However, I haven''t yet >>> done >>> much research about older browsers'' support of HTML 5. >> >> I think the poster meant something like: I use some of the newer CSS >> features and maybe some HTML5 attributes. Older browsers will simply >> ignore those and move on. > > ...or not. Yes, of course it''s fine to use new attributes that older > browsers will ignore. However, HTML 5 differs from HTML 4 not just in > its repertoire of attributes and elements, but also *in its basic > syntax* -- HTML 5 is no longer a subset of SGML as HTML ≤4 is. > That''s > the part that (potentially) breaks graceful degradation.Uhu, completely agree. But I''ve noticed a lot of people are throwing around "HTML5" these days like "Web 2.0" in the recent past. The major difference being that HTML5 actually isn''t an empty shell like Web 2.0 was, but actually has a more-or-less well defined meaning. Anyway, back to the "HTML4 rather than XHTML", which has little to do with HTML5 anyway. IE6 perfectly supports XHTML and its <br /> tags (with all of the usual IE6 quirks of course), so there is no reason to go to HTML4 if that is your concern. Best regards Peter De Berdt -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Rimantas Liubertas
2010-Oct-26 08:10 UTC
Re: Re: Re: Forcing rails to output HTML4 rather then XHTML?
>> ...or not. Yes, of course it''s fine to use new attributes that older >> browsers will ignore. However, HTML 5 differs from HTML 4 not just in >> its repertoire of attributes and elements, but also *in its basic >> syntax* -- HTML 5 is no longer a subset of SGML as HTML ≤4 is. That''s >> he part that (potentially) breaks graceful degradation.It breaks absolutely nothing. More than that, only because browsers don''t give a damn about SGML rules all that XHTML nonsense was possible: according to SGML <br /> should be rendered as if it was <br> > (search for SGML SHORTTAG).> Anyway, back to the "HTML4 rather than XHTML", which has little to do with > HTML5 anyway. IE6 perfectly supports XHTML and its <br /> tags (with all of > the usual IE6 quirks of course), so there is no reason to go to HTML4 if > that is your concern.IE6 (and any version of IE) does not support XHTML at all. Try to feed them proper XHTML (that''s with the MIME type application/xhtml+xml) and see what happens. They just silently ignore all those slashes. HTML5 finally fixes this, and you can use a syntax you like for your HTML5 documents. However, if you want XHTML5 you MUST server your document with application/xhtml+xml: and by doing so be aware of all the differences in behaviour this brings. Regards, Rimantas -- http://rimantas.com/ -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2010-Oct-26 16:08 UTC
Re: Re: Re: Forcing rails to output HTML4 rather then XHTML?
Rimantas Liubertas wrote in post #957137:>>> ...or not. Yes, of course it''s fine to use new attributes that older >>> browsers will ignore. However, HTML 5 differs from HTML 4 not just in >>> its repertoire of attributes and elements, but also *in its basic >>> syntax* -- HTML 5 is no longer a subset of SGML as HTML ≤4 is. That''s >>> he part that (potentially) breaks graceful degradation. > > It breaks absolutely nothing.You cannot possibly know this with certainty, I think. Since non-HTML5-aware browsers use SGML syntax in non-XHTML documents, HTML5 self-closing tags shouldn''t be interpreted as self-closing tags (and are invalid HTML4 due to the trailing >). The fact that, in practice, most browsers are lenient in this respect doesn''t mean that this behavior should be relied on.> More than that, only because browsers > don''t give > a damn about SGML rules all that XHTML nonsense was possible:I think you''ve got it backwards. Self-closing XML-tags only became necessary to support in browsers when XHTML was introduced. Before that, no one would have thought to use them, and so SGML parsing could (and perhaps should) have been the order of the day.> according to SGML <br /> should be rendered as if it was <br> > > (search for > SGML SHORTTAG).Right. So the trailing > isn''t valid HTML4, so you can''t assume that you can use it (outside an XHTML context) in a pre-HTML5 browser.> >> Anyway, back to the "HTML4 rather than XHTML", which has little to do with >> HTML5 anyway. IE6 perfectly supports XHTML and its <br /> tags (with all of >> the usual IE6 quirks of course), so there is no reason to go to HTML4 if >> that is your concern. > > IE6 (and any version of IE) does not support XHTML at all. Try to feed > them > proper XHTML (that''s with the MIME type application/xhtml+xml) and see > what > happens.I think this was finally fixed in IE7, IIRC.> They just silently ignore all those slashes.Right.> > HTML5 finally fixes this, and you can use a syntax you like for your > HTML5 > documents. However, if you want XHTML5 you MUST server your document > with application/xhtml+xml: and by doing so be aware of all the > differences > in behaviour this brings.Yup.> > > Regards, > RimantasBest, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2010-Oct-26 16:14 UTC
Re: Re: Forcing rails to output HTML4 rather then XHTML?
Robert Walker wrote in post #957044:> Marnen Laibow-Koser wrote in post #956924: >> Right. But when the syntax -- not just the semantics -- changes, then I >> start worrying. Time for me to do more research. > > Okay, so let''s talk specifics. Assuming valid HTML 5 markup with no HTML > 5 specific features, what breaks on what browsers.Valid HTML 5 markup (with XML-style self-closing tags) is invalid HTML 4 markup (because, as Rimantas said, in HTML 4, <br/> is equivalent to <br>>, with an invalid extra >). That''s all you need to know to know that this is a bad thing. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen @marnen.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Robert Walker
2010-Oct-26 20:56 UTC
Re: Re: Forcing rails to output HTML4 rather then XHTML?
Marnen Laibow-Koser wrote in post #957260:> Robert Walker wrote in post #957044: >> Okay, so let''s talk specifics. Assuming valid HTML 5 markup with no HTML >> 5 specific features, what breaks on what browsers. > > Valid HTML 5 markup (with XML-style self-closing tags) is invalid HTML 4 > markup (because, as Rimantas said, in HTML 4, <br/> is equivalent to > <br>>, with an invalid extra >). That''s all you need to know to know > that this is a bad thing.I''m was not asking about validity. Markup validity is directly dependent upon the DOCTYPE specified for the page. What I''m trying to find out is specifically how IE 6 breaks (as in incorrectly renders the page) when using valid HTML 5 markup (including self-closing tags) with <!DOCTYPE html>. Again assume no HTML 5 only features only markup syntax. I''m asking because I don''t personally use any version of IE, much less IE 6. I''d really like to know if IE 6 actually has problems rending HTML 5 markup. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Walter Lee Davis
2010-Oct-26 22:12 UTC
Re: Re: Re: Forcing rails to output HTML4 rather then XHTML?
On Oct 26, 2010, at 4:56 PM, Robert Walker wrote:> Marnen Laibow-Koser wrote in post #957260: >> Robert Walker wrote in post #957044: >>> Okay, so let''s talk specifics. Assuming valid HTML 5 markup with >>> no HTML >>> 5 specific features, what breaks on what browsers. >> >> Valid HTML 5 markup (with XML-style self-closing tags) is invalid >> HTML 4 >> markup (because, as Rimantas said, in HTML 4, <br/> is equivalent to >> <br>>, with an invalid extra >). That''s all you need to know to know >> that this is a bad thing. > > I''m was not asking about validity. Markup validity is directly > dependent > upon the DOCTYPE specified for the page. > > What I''m trying to find out is specifically how IE 6 breaks (as in > incorrectly renders the page) when using valid HTML 5 markup > (including > self-closing tags) with <!DOCTYPE html>. Again assume no HTML 5 only > features only markup syntax. > > I''m asking because I don''t personally use any version of IE, much less > IE 6. I''d really like to know if IE 6 actually has problems rending > HTML > 5 markup.I haven''t tried it myself, and I upgraded my test machine to IE8 at the beginning of the summer, but I believe that it treats it like "tag soup" and ignores any tag that it doesn''t understand. That is, it shows the content of that unknown tag, but it doesn''t apply any special meaning to the tag. It would likely be Quirks Mode all the way down, definitely not something that looked like you cared about that browser, but it would be readable in the sense that all the words would be there. Walter -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2010-Oct-27 00:36 UTC
Re: Re: Re: Forcing rails to output HTML4 rather then XHTML?
Walter Davis wrote in post #957346:> On Oct 26, 2010, at 4:56 PM, Robert Walker wrote: > >>> that this is a bad thing. >> >> I''m asking because I don''t personally use any version of IE, much less >> IE 6. I''d really like to know if IE 6 actually has problems rending >> HTML >> 5 markup. > > I haven''t tried it myself,Nor have I.> and I upgraded my test machine to IE8 at > the beginning of the summer, but I believe that it treats it like "tag > soup" and ignores any tag that it doesn''t understand. That is, it > shows the content of that unknown tag, but it doesn''t apply any > special meaning to the tag. It would likely be Quirks Mode all the way > down, definitely not something that looked like you cared about that > browser, but it would be readable in the sense that all the words > would be there.That would be my guess as well.> > WalterBest, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Rimantas Liubertas
2010-Oct-27 07:32 UTC
Re: Re: Re: Forcing rails to output HTML4 rather then XHTML?
> What I''m trying to find out is specifically how IE 6 breaks (as in > incorrectly renders the page) when using valid HTML 5 markup (including > self-closing tags) with <!DOCTYPE html>. Again assume no HTML 5 only > features only markup syntax. > > I''m asking because I don''t personally use any version of IE, much less > IE 6. I''d really like to know if IE 6 actually has problems rending HTML > 5 markup.It does not break. The only thing that doctype affects in IE6 is rendering mode. HTML5 doctype forces IE6 into "standards compliant" mode, see [1] for more details. In fact, because unknown doctype (which html5 doctype was for earlier browsers) forces them to use standards rendering mode is THE reason HTML5 has doctype at all. You can omit doctype for your XHTML5 pages, because they MUST be served with application/xhtml+xml MIME type and then it is this MIME that tells browsers how to treat you document, no doctype necessary. So if your web page was using any of doctypes which would cause IE to be in standards compliant mode it will behave just the same with HTML5 doctype. However, if your page was developed for quirks mode, HTML5 doctype will switch IE6 into standards compliant rendering and things may (will?) break horribly. The most probable case is different box model, but there are other differences too, see the link below for the details. [1] http://msdn.microsoft.com/en-us/library/bb250395(VS.85).aspx Regards, Rimantas -- http://rimantas.com/ -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.