Skip to content

Commit

Permalink
Merge pull request #495 from Yoast/stories/af/485-snippetpreview-brea…
Browse files Browse the repository at this point in the history
…dcrumbs-url-parse-no-query-hash

Strip out question mark and hash characters from the snippet preview …
  • Loading branch information
xyfi committed May 7, 2018
2 parents 47287d3 + 182f80c commit 6b113cd
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,9 @@ export default class SnippetPreview extends PureComponent {
*/
getBreadcrumbs() {
const { url, breadcrumbs } = this.props;
const { protocol, hostname, pathname } = parse( url );
// Strip out question mark and hash characters from the raw URL.
const cleanUrl = url.replace( /\?|#/g, "" );
const { protocol, hostname, pathname } = parse( cleanUrl );

const hostPart = protocol === "https:" ? protocol + "//" + hostname : hostname;

Expand Down

0 comments on commit 6b113cd

Please sign in to comment.