mirror of
https://github.com/Redocly/redoc.git
synced 2025-02-19 19:30:32 +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
|
const normalizedUrl = options.expandDefaultServerVariables
|
||||||
? expandDefaultServerVariables(server.url, server.variables)
|
? expandDefaultServerVariables(server.url, server.variables)
|
||||||
: server.url;
|
: server.url;
|
||||||
|
const basePath = getBasePath(normalizedUrl);
|
||||||
return (
|
return (
|
||||||
<ServerItem key={normalizedUrl}>
|
<ServerItem key={normalizedUrl}>
|
||||||
<Markdown source={server.description || ''} compact={true} />
|
<Markdown source={server.description || ''} compact={true} />
|
||||||
|
@ -74,7 +75,9 @@ export class Endpoint extends React.Component<EndpointProps, EndpointState> {
|
||||||
<ServerUrl>
|
<ServerUrl>
|
||||||
<span>
|
<span>
|
||||||
{hideHostname || options.hideHostname
|
{hideHostname || options.hideHostname
|
||||||
? getBasePath(normalizedUrl)
|
? basePath === '/'
|
||||||
|
? ''
|
||||||
|
: basePath
|
||||||
: normalizedUrl}
|
: normalizedUrl}
|
||||||
</span>
|
</span>
|
||||||
{operation.path}
|
{operation.path}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user