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

Double dash formatting could confuse users #923

Closed
amirrustam opened this issue Sep 10, 2018 · 7 comments
Closed

Double dash formatting could confuse users #923

amirrustam opened this issue Sep 10, 2018 · 7 comments
Milestone

Comments

@amirrustam
Copy link
Contributor

In an info box, the theme seems to combine two dashes into one, turning --record into -record which can confuse people.

screen shot 2018-09-10 at 4 06 32 pm

@richdouglasevans
Copy link
Contributor

If you add smartypants: false to the _config.yml file then the issue goes away.

marked:
  autolink: false
  smartypants: false

bingo

However, that's kinda nuclear: it turns off SmartyPants processing for the entire site.

"[SmartyPants] easily translates plain ASCII punctuation characters into “smart” typographic punctuation HTML entities."

SmartyPants can perform the following transformations:

  • Straight quotes ( " and ' ) into “curly” quote HTML entities
  • Backticks-style quotes (``like this'') into “curly” quote HTML entities
  • Dashes (“--” and “---”) into en- and em-dash entities
  • Three consecutive dots (“...”) into an ellipsis entity

I dunno that there's all that many occurrences of the above markdown that is transformed by SmartyPants; I know that I've been explicitly adding — and &hellips; to the source code on the odd occasion that I needed them. (I didn't know that SmartyPants was even a thing.)

There's the tactical approach where SmartyPants is turned off which is appealing because it can be done right now and stops users possibly getting confused. Downside is that the sweet typography goes away... which I'm not sure is all that big a deal when compared to removing a source of possible confusion.

Then there's the strategic approach which is to keep SmartyPants turned on but sort out why it's FoJangledZor in the note blocks.

Thoughts?

Random Guy On The Internet votes for the tactical approach to be merged in but for the ticket to remain open.

😄

@jennifer-shehane
Copy link
Member

jennifer-shehane commented Sep 11, 2018

From smartypants docs, it shouldn't format anything in code blocks like this example is.

SmartyPants does not modify characters within <pre>, <code>, <kbd>, or <script> tag blocks.

Honestly, I'm not seeing a lot of benefit from SmartyPants. It's very much not worth having actual code flags rendering incorrectly. I would turn off SmartyPants

Still, yes, there is likely something not being handled correctly in our note blocks that this just puts a bandaid over.

@amirrustam
Copy link
Contributor Author

when I turn off smartypants, I get an Request to: network-requests#Don’t-Stub-Responses failed.

@richdouglasevans
Copy link
Contributor

richdouglasevans commented Sep 11, 2018

Yeah 😢

With SmartyPants turned off completely it means that the anchors aren't processed. Anchors with ' in 'em such as Don't Stub Responses get encoded into Don-39-t-Stub-Responses and well, yeah, bleurgh.

I've submitted a PR that tactically addresses this. The PR doesn't close this issue 'cos I'll look to solve the problem at source.

@richdouglasevans
Copy link
Contributor

I've submitted a PR to the marked project to solve this issue at source.

markedjs/marked#1335

I dunno if the PR will be accepted, but if it is:

  • and there is a subsequent release
  • then we can explicitly bump the version of marked in the cypress docs so that Hexo picks it up
  • and Amir and I can resume partying like it is 1999.

OMG the tension on this important issue itt iz srs bsnss 😰😝

@richdouglasevans
Copy link
Contributor

I've submitted a PR to the marked project to solve this issue at source.

That fix has been released. I'll test it locally to see if it fixes this issue and, if so, then I'll create a PR to address it and revert the earlier tactical fix... but later this week, possibly next weekend 'cos I'm proper busy at the mo'.

https://github.com/markedjs/marked/releases/tag/v0.5.1

@amirrustam
Copy link
Contributor Author

Thanks @richdouglasevans

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

3 participants