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

Why do I use Chinese in the @module, the method below the module cannot be opened in the page #118

Closed
bubble1001 opened this issue Aug 29, 2023 · 5 comments

Comments

@bubble1001
Copy link

I used the Chinese in @module, so in the generated document page, when I click the function name under the Chinese name, the page displays "Your file couldn't be accessed", it seems that the url has been used 'encodedURI()' many times

@ar2rsawseen
Copy link
Collaborator

Hello,
can you provide small example to reproduce?

@bubble1001
Copy link
Author

My usage is like this:

/**@module 加法 */

/**

  • @function add
  • @param {number} a - 第一个参数
  • @param {number} b - 第二个参数
  • @returns {number} - 返回两个参数的和
    */
    function add(a, b) {
    return a + b;
    }

In the final generated document page, click the add() method under the document directory "加法", and the page prompts "Your file couldn't be accessed"
image

@ar2rsawseen
Copy link
Collaborator

Hello,
thank you, I could track it to JSDoc place here:
https://github.com/jsdoc/jsdoc/blob/main/packages/jsdoc-template-legacy/lib/templateHelper.js#L351

So, most probably, it is not a template problem but JSDoc problem in overall.

Have you experienced the same with the default JSDoc template?

@ar2rsawseen
Copy link
Collaborator

ar2rsawseen commented Aug 29, 2023

So for example, as far as I see
here https://github.com/clenemt/docdash/blob/master/publish.js#L386
we feed method.longname as module:加法~add
and get result as <a href="module-%2525E5%25258A%2525A0%2525E6%2525B3%252595.html#~add">add</a>
which is already double encoded

@bubble1001
Copy link
Author

Thanks for your reply, but I don't have same problem when I use other templates. And after I fix it like this, the above problem will not occur again. #119,

bubble1001 pushed a commit to bubble1001/docdash that referenced this issue Aug 30, 2023
bubble1001 pushed a commit to bubble1001/docdash that referenced this issue Aug 30, 2023
ar2rsawseen added a commit that referenced this issue Aug 30, 2023
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

No branches or pull requests

2 participants