#163 ✓resolved
Michael Granger

Parser ignores class and ID names with capital letters

Reported by Michael Granger | August 2nd, 2009 @ 02:26 PM

When I try to set the class or ID of a any element to a string containing an uppercase letter, Redcloth (as of 4.2.2) ignores it. Here's a testcase that illustrates a few different ways that this breaks things:

  h3. A regular heading
  
  h3(#anid). A heading with an all-lower ID
  
  h3(#anId). A heading with a mixed-case ID
  
  h3(#SECTION4). A heading with an uppercase ID
  
  p(#anotherId). A paragraph with a mixed-case ID.
  
  p(mixedClass). A paragraph with a mixed-case class.
  
  p. This is %(camelCase)a camelCased span%, and %(another)one that's not%.

I expected the above to render like this:

  <h3>A regular heading</h3>
  <h3 id="anid">A heading with an all-lower ID</h3>
  <h3 id="anId">A heading with a mixed-case ID</h3>
  <h3 id="SECTION4">A heading with an uppercase ID</h3>
  <p id="anotherId">A paragraph with a mixed-case ID.</p>
  <p class="mixedClass">A paragraph with a mixed-case class.</p>
  <p>This is <span class="camelCase">a camelCased span</span>, and <span class="another">one that&#8217;s not</span>.</p>

but it rendered like this instead:

  <h3>A regular heading</h3>
  <h3 id="anid">A heading with an all-lower ID</h3>
  <p>h3(#anId). A heading with a mixed-case ID</p>
  <p>h3(#SECTION4). A heading with an uppercase ID</p>
  <p>p(#anotherId). A paragraph with a mixed-case ID.</p>
  <p>p(mixedClass). A paragraph with a mixed-case class.</p>
  <p>This is <span>(camelCase)a camelCased span</span>, and <span class="another">one that&#8217;s not</span>.</p>

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

RedCloth is a Ruby library for converting Textile into HTML

Shared Ticket Bins

People watching this ticket

Pages