Skip to content

Colon (:) between 2 words in header disappears #679

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

Closed
sylwekb opened this issue Nov 2, 2018 · 14 comments
Closed

Colon (:) between 2 words in header disappears #679

sylwekb opened this issue Nov 2, 2018 · 14 comments
Labels
bug confirmed as a bug

Comments

@sylwekb
Copy link

sylwekb commented Nov 2, 2018

Hey,

I use a header like this:

### `/autocontrast:3/`

The result is:
screen shot 2018-11-02 at 12 36 18

And the html looks like this:

screen shot 2018-11-02 at 12 37 06

Tried on Firefox and Chrome, in both cases the :3 is missing. I have the noEmoji: true, setting but it seems docsify still tries to parse.

Please help :)

@cheng-kang
Copy link
Contributor

FYI: https://daringfireball.net/projects/markdown/syntax#backslash

`/autocontrast:3/`

/autocontrast:3/

// Correct
### \`/autocontrast:3/\`

// Wrong
### `/autocontrast:3/`

@sylwekb
Copy link
Author

sylwekb commented Nov 2, 2018

Hey, thanks for a quick answer, unfortunately it didn't work:

### \`/autocontrast:3/\`

Produces:
screen shot 2018-11-02 at 14 41 44

@cheng-kang
Copy link
Contributor

Ah, sorry, I missed the :3 part. My guess is that the problem is with config parsing. Because Docsify allows users to configure by adding :CONFIG_NAME=CONFIG_CONTENT.

Will check later.

@cheng-kang cheng-kang reopened this Nov 2, 2018
@sylwekb
Copy link
Author

sylwekb commented Nov 2, 2018

... Docsify allows users to configure by adding :CONFIG_NAME=CONFIG_CONTENT.

Thanks! I would be equally happy with a workaround if a proper fix is too complicated ;) Can you point to the documentation which describes this :config behavior? For me it looks like it's alias https://docsify.js.org/#/configuration?id=alias but i'm not sure nope, sorry, just noticed it's for routes

@cheng-kang
Copy link
Contributor

This page describes a few configs you can use: https://docsify.js.org/#/helpers?id=customise-id-for-headings

@sylwekb
Copy link
Author

sylwekb commented Nov 2, 2018

To everybody who has the same problem. The regexp is here. The workaround I found is to use other colon: https://unicode-table.com/en/A789/
Normal colon: :
Modifier Letter Colon:

@sylwekb
Copy link
Author

sylwekb commented Nov 2, 2018

Just realized it's not good workaround if you allow users to copy it and use somewhere where the fact that it's a real colon is important ;D

@sylwekb
Copy link
Author

sylwekb commented Nov 2, 2018

AFAIU It does not make sense to set more than 1 id for heading, so it's enough to remove g at the end of the regexp https://github.com/docsifyjs/docsify/blob/v4.8.5/src/core/render/compiler.js#L22

@QingWei-Li
Copy link
Member

We should allow the user to use the content of :xx=yy, just match it to when \:xx=yy will not be processed.

@QingWei-Li QingWei-Li added the bug confirmed as a bug label Nov 3, 2018
@vsespb
Copy link

vsespb commented Nov 27, 2018

We should allow the user to use the content of :xx=yy, just match it to when \:xx=yy will not be processed.

We're affected by current bug and we use same Markdown in docsify and NOT in docsify at same time. So adding escapes like this \:xx=yy to all our markdown will damage it for world outside of docsify.

maybe use this PR instead #708
i.e. process configs only when there is a space/start of line before colon.

@Kikobeats
Copy link
Contributor

Related: #698

@jonesjj
Copy link

jonesjj commented Dec 29, 2018

To everybody who has the same problem. The regexp is here. The workaround I found is to use other colon: https://unicode-table.com/en/A789/
Normal colon: :
Modifier Letter Colon:

This proved an acceptable workaround for me. Thanks @sylwekb

@sylwekb
Copy link
Author

sylwekb commented Dec 30, 2018

@jonesjj be careful. If you want your users/readers to be able to use the headline by copying it, they will copy the wrong colon, and anything that needs to interpret it won't work - that's my case.

@anikethsaha
Copy link
Member

This has been resolved . Update to latest version

PLease comment if it still an issue

Firefox

image

Chrome

image

Edge

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug confirmed as a bug
Projects
None yet
Development

No branches or pull requests

7 participants