Skip to content

Commit

Permalink
Recognize .htm and .xhtml location extensions as HTML
Browse files Browse the repository at this point in the history
  • Loading branch information
sstephenson committed May 23, 2016
1 parent d3b75ae commit c23dbe1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/turbolinks/location.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ class Turbolinks.Location
@getPathComponents().slice(-1)[0]

getExtension: ->
@getLastPathComponent().match(/\.[^.]*$/)?[0]
@getLastPathComponent().match(/\.[^.]*$/)?[0] ? ""

isHTML: ->
extension = @getExtension()
extension is ".html" or not extension?
@getExtension().match(/^(?:|\.(?:htm|html|xhtml))$/)

isPrefixedBy: (location) ->
prefixURL = getPrefixURL(location)
Expand Down

0 comments on commit c23dbe1

Please sign in to comment.