mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-22 16:46:34 +03:00
fix: remove duplicated slash if hideHostname option enabled (#1448)
This commit is contained in:
parent
4567534cbb
commit
4729fc3d8f
|
@ -67,6 +67,7 @@ export class Endpoint extends React.Component<EndpointProps, EndpointState> {
|
|||
const normalizedUrl = options.expandDefaultServerVariables
|
||||
? expandDefaultServerVariables(server.url, server.variables)
|
||||
: server.url;
|
||||
const basePath = getBasePath(normalizedUrl);
|
||||
return (
|
||||
<ServerItem key={normalizedUrl}>
|
||||
<Markdown source={server.description || ''} compact={true} />
|
||||
|
@ -74,7 +75,9 @@ export class Endpoint extends React.Component<EndpointProps, EndpointState> {
|
|||
<ServerUrl>
|
||||
<span>
|
||||
{hideHostname || options.hideHostname
|
||||
? getBasePath(normalizedUrl)
|
||||
? basePath === '/'
|
||||
? ''
|
||||
: basePath
|
||||
: normalizedUrl}
|
||||
</span>
|
||||
{operation.path}
|
||||
|
|
Loading…
Reference in New Issue
Block a user