Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slugifying non-ascii headers make duplicate permalinks #264

Merged
merged 2 commits into from
May 3, 2017

Conversation

Joe-noh
Copy link
Contributor

@Joe-noh Joe-noh commented May 3, 2017

Problem

I have following OpenAPI yaml which markdown headers are composed of non-ascii characters.

swagger: "2.0"
info:
  title: サンプルAPI
  description: |
    # サンプルAPI

    サンプルのAPIドキュメントです。

    ## 利用手順

    はじめにデベロッパー登録してください。

    ## エラー

    以下のような形式でエラーを返します。

ReDoc will slugify these headers to make permanent links. However non-ascii-only header will be converted into same section names like this. They don't work well as permanent links.

# サンプルAPI -> slugify -> "API" ->"/#section/API"

## 利用手順 -> slugify -> "" -> "/#section/API/"

## エラー -> slugify -> "" -> "/#section/API/"

I committed Joe-noh@32f2f7f. This uses original header title if slugified title is empty. I guess this is simplest solution for this problem. Please let me know if there are any other good options.

Thanks. Joe.

@RomanHotsiy RomanHotsiy merged commit 6edbbe7 into Redocly:master May 3, 2017
@RomanHotsiy
Copy link
Member

@Joe-noh thanks for the PR
merged

Will notify you once new version is published

@Joe-noh
Copy link
Contributor Author

Joe-noh commented May 3, 2017

Thank you!

@Joe-noh Joe-noh deleted the markdown-header-slugified branch May 8, 2017 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants