Skip to content
This repository has been archived by the owner on Mar 9, 2024. It is now read-only.

Commit

Permalink
Commit changes made to url package
Browse files Browse the repository at this point in the history
  • Loading branch information
mattyrob committed Oct 19, 2023
1 parent b12fc41 commit 4d42d93
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/wp-includes/js/dist/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -1246,8 +1246,10 @@ function filterURLForDisplay(url, maxLength = null) {
if (filteredURL.match(/^[^\/]+\/$/)) {
filteredURL = filteredURL.replace('/', '');
}
const mediaRegexp = /([\w|:])*\.(?:jpg|jpeg|gif|png|svg)/;
if (!maxLength || filteredURL.length <= maxLength || !filteredURL.match(mediaRegexp)) {

// capture file name from URL
const fileRegexp = /\/([^\/?]+)\.(?:[\w]+)(?=\?|$)/;
if (!maxLength || filteredURL.length <= maxLength || !filteredURL.match(fileRegexp)) {
return filteredURL;
}

Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/js/dist/url.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4d42d93

Please sign in to comment.