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

Editor highlighting for Markdown italics do not match rendered brew #852

Closed
HeruAsatru opened this issue Sep 26, 2019 · 6 comments
Closed

Comments

@HeruAsatru
Copy link

Here is the original post on reddit.

When a markdown element is positioned at the beginning of text, the text is highlighted with the meaning of that element. This is true even if the element is a closing element

An example can be seen on the default Homebrewery at line 7, there is no space between the ** and "Simply..." which highlights the rest of the line in bold font, even though the bold only applies to "Try it!"

https://i.redd.it/pmz687lzg5m31.png

@ericscheid
Copy link
Collaborator

Is this a bug in markdown, or a bug in whatever is used to style and format the brew code (which is markdown code)? This appears in the editing pane, but everything is OK in the display pane.

The bug seems to be triggered by the space in front of the terminating bold marker, not the space-or-lack after it.

This brew code:

1. **line starts with bold-marker but has no end marker
2. **marked for bolding** usual proper coding
3. **marked for bolding**no space here
4. **marked for bolding **misplaced space
5. **marked for bolding ** space either side of end-bolder

Looks like this in the editor:

  1. **line starts with bold-marker but has no end marker
  2. **marked for bolding** usual proper coding
  3. ****marked for bolding****no space here
  4. **marked for bolding **misplaced space
  5. **marked for bolding ** space either side of end-bolder

Same thing happens with *italics*

Looks like a problem with the codemirror lib.

@calculuschild
Copy link
Member

codemirror may very well have some updates that fix this problem. I know a lot of packages have fallen out of date and it might be time to start going through those and making sure updating those isn't going to break stuff.

@calculuschild
Copy link
Member

I submitted a bug report to Codemirror. This is indeed on their side.

@calculuschild calculuschild added the blocked Waiting on a dependency, other feature, etc., first label May 8, 2020
@ericscheid
Copy link
Collaborator

The was a recent bump of codemirror, and now the test cases above are slightly improved but not fixed.

@calculuschild
Copy link
Member

calculuschild commented Nov 9, 2020

Link to the bug report I submitted codemirror/codemirror5#6264

Seems like this particular behavior is actually correct according to the Markdown specs. It is actually our out-of-date that is rendering invalid styling (and even Github is still getting it wrong in a few cases). Once we update the Marked.js library for us in the new render pipeline, the Markdown with spaces between asterisks will actually stop working, which will help users create better, valid Markdown and lead to fewer syntax errors and weird formatting issues.

@calculuschild calculuschild mentioned this issue Nov 10, 2020
46 tasks
@calculuschild calculuschild added ✅ Added to V3 and removed blocked Waiting on a dependency, other feature, etc., first labels Jul 27, 2021
@calculuschild calculuschild changed the title Markdown Bug Editor highlighting for Markdown italics do not match rendered brew Jul 27, 2021
@calculuschild
Copy link
Member

Added to the V3 changelog finally. Closing.

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