Skip to content
  • Andrew White's avatar
    48b37f12
    Update `titlelize` regex to allow apostrophes · 48b37f12
    Andrew White authored
    In 4b685aad the regex in `titlelize` was updated to not match
    apostrophes to better reflect the nature of the transformation.
    Unfortunately this had the side effect of breaking capitalization
    on the first word of a sub-string, e.g:
    
      >> "This was 'fake news'".titleize
      => "This Was 'fake News'"
    
    This is fixed by extending the look-behind to also check for a
    word character on the other side of the apostrophe.
    
    Fixes #28312.
    48b37f12
    Update `titlelize` regex to allow apostrophes
    Andrew White authored
    In 4b685aad the regex in `titlelize` was updated to not match
    apostrophes to better reflect the nature of the transformation.
    Unfortunately this had the side effect of breaking capitalization
    on the first word of a sub-string, e.g:
    
      >> "This was 'fake news'".titleize
      => "This Was 'fake News'"
    
    This is fixed by extending the look-behind to also check for a
    word character on the other side of the apostrophe.
    
    Fixes #28312.
Loading