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

Use of dollar sign in inline code producing odd results #288

Closed
rfulkerson opened this issue Jun 24, 2015 · 1 comment
Closed

Use of dollar sign in inline code producing odd results #288

rfulkerson opened this issue Jun 24, 2015 · 1 comment
Milestone

Comments

@rfulkerson
Copy link

When using the following in Gmail or Blackboard, the conversion is wonky due to the first line:

Markdown:

* Need `'$'` in constructor

* Constructor and `display` don't have parameters

* No `return` for `menuChoice`

* Method `display` should not call `menuChoice()`

* Input in `menuChoice` should use `input.next().charAt(0)`

The output:

Need `’ in constructor

Constructor and display don’t have parameters

No return for menuChoice

Method display should not call menuChoice()

Input in menuChoice should use input.next().charAt(0)

` in constructor

Constructor and 0.07960530809955746 don’t have parameters

No 0.967272506292158 for 0.849369396167897

Method 0.9170844589050049 should not call 0.31504472305241105

Input in 0.1455992251161714 should use 0.2595394013807545

It appears to be the $ that's throwing it off in the first line. If I remove the first line entirely or change it to something like 'c' (replacing the $ with a regular character), it works like a peach.

This is feedback for a Java course I'm teaching, and one of the things the students need to do is initialize a char variable to a dollar sign character, so I'm trying to give them feedback to that effect, but getting the weird results.

I've tried escaping the $ character (though I didn't see anything about needing to do that anywhere) and that doesn't seem to work. :)

If I've missed something obvious, sorry for the bandwidth. I've been using Markdown and Markdown Here for years and this is the first really weird conversion issue I've stumbled across.

Thanks for the great work!

Any insights?

@adam-p adam-p closed this as completed in 498d796 Jul 14, 2015
@adam-p
Copy link
Owner

adam-p commented Jul 14, 2015

It turns out the problem is user input gets passed as the replacement argument to a String.replace() call, but the replacement argument isn't just a plain string -- it has some magic values, including "$`".

The workaround is: Where you have one of the magic dollar-sign values, use two dollar signs. So, "$$`", etc.

Fixed in rev 498d796. Will be in next release.

Thanks.


Somewhat funny: The same problem seems to affect the Mocha test runner. When the test I added fails it prints out:

AssertionError: expected '`' to equal '`expected '`' to equal '

@adam-p adam-p modified the milestones: Next release, Next-next release Jul 14, 2015
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