docsify icon indicating copy to clipboard operation
docsify copied to clipboard

links not working properly for quoted headings

Open yogitheboss opened this issue 2 years ago • 5 comments

Bug Report

Steps to reproduce

create a navigation list using

  • heading
  • heading if we create a heading "link1_heading" "link2_heading" the links doesn't work in docsify generated webpage as the id attribute is "quotlink1_headingquot"

What is current behaviour

the links doesn't work if quotation is included in the name , as id generated of the heading is quot_id_quot instead of quot .

What is the expected behavior

the links should work fine as the readme file treats quotes and no quotes the same

Other relevant information

this bug is causing the https://p5js.org/contributor-docs/#/./contributor_guidelines page's some links to not work eg. "found a bug" , "Existing Feature Enhancement" etc. New Feature Request Discussion"

  • [x] Bug does still occur when all/other plugins are disabled?

  • Your OS: windows 10

  • Node.js version: v16.13.2.

  • npm/yarn version: v8.3.2

  • Browser version: v109.0.5414.75

  • Docsify version: 4.4.4

  • Docsify plugins:

Please create a reproducible sandbox

Edit 307qqv236

Mention the docsify version in which this bug was not present (if any)

yogitheboss avatar Jan 18 '23 14:01 yogitheboss

Hi @yogitheboss , IIRC, It has been fixed, plz update the docsify version https://cdn.jsdelivr.net/npm/docsify@4/lib/docsify.min.js to have a try.

Koooooo-7 avatar Jan 20 '23 09:01 Koooooo-7

@Koooooo-7 , I checked again but still the problem persists . I am using latest version of docsify but still the links aren't working. the data id of element(headings) are still quot_name_quot instead of name because of which links aren't working.

yogitheboss avatar Jan 20 '23 11:01 yogitheboss

I see, I understand the issue now. And I think it works as current expected behavior tho. When the heading contains ", it will be escaped to " in html, and we trim it to quot instead of remove it directly. Otherwise the sidebar would remove the quote as well.

Normally, I believe it should not be treat as the same.

"The content"

and

The content

I suppose that you may need surround with quot at the anchor or use the customer id heading instead. i.e.

The heading is "The subtitle" and custom this heading's id.

## "The subtitle"  :id=my-customer-id

and when you have the anchor in the content you can do like this.

I wanna jump to the [subtitle](#my-customer-id) now.

Koooooo-7 avatar Jan 20 '23 14:01 Koooooo-7

I think I have got my answer , Thanks for responding @Koooooo-7 I am closing the issue

yogitheboss avatar Feb 08 '23 19:02 yogitheboss

@Koooooo-7 the custom id is working with docsify but markdown renderer isn't rendering it properly

yogitheboss avatar Feb 10 '23 14:02 yogitheboss