You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If window.location.pathname has URI-encoded components (like %20 for spaces), then the title comes out quite ugly (and titleize()) doesn't work as intended. Using decodeURI(window.location.pathname.replace(/\/$/g, '')) solves it.
Personally, I got rid of the toLowerCase()titleize() altogether.
The text was updated successfully, but these errors were encountered:
FWIW I think you should also get rid of the toLowerCase(). I scanned through a bunch of indexes of media folders, and it looks funny when the function uncapitalizes something because it's in the middle of a word or next to a non space character. If you remove the lower case, it will still capitalize everything next to a space hyphen underscore, etc. but will leave existing capitals untouched.
Not sure what your intended behavior/typical scenario is. It's not hard for users to change, in any case.
If
window.location.pathname
has URI-encoded components (like%20
for spaces), then the title comes out quite ugly (andtitleize()
) doesn't work as intended. UsingdecodeURI(window.location.pathname.replace(/\/$/g, ''))
solves it.Personally, I got rid of the
toLowerCase()
titleize()
altogether.The text was updated successfully, but these errors were encountered: