$ sign in text causes issues
Ran into an odd thing today where if you have two $ signs within your text, the text in between them greys out and MD syntax no longer works visually (it still previews OK). E.g.
Lorem ipsum dolor sit amet $20, consectetur adipisicing elit. Debitis cum blanditiis omnis eligendi repellat.
## Heading
porro quisquam iste sapiente assumenda, dicta, odit libero nihil? Quasi, $50 harum molestias explicabo ullam praesentium soluta.
Produces this:
Same here with macdown 0.5.2/0.5.3 & Mac OS X 10.11.1
Using Version 0.5.3 (697) on El Capitan 10.11.1 (15B42). Can confirm this problem.
It may be confusing it with inline math
See in the preferences -> rendering -> Tex-like math syntax if it's activated as well as the child use dollar sign
@laughingrice Interesting—although those options aren't activated in my case.
Unfortunately this is currently not fixable because we are not able to tweak editor highlighting dynamically like the previewing pane. I have been looking for a better syntax highlighter without luck for a while now.
(I submitted the previous comment prematurely.)
A cruel workaround is to make dollar signs escapable, i.e. you can write Apple is \$5. Orange \$4. This is compatible with other Markdown renderers too.
A cruel workaround is to make dollar signs escapable
Heh, not a bad solution, and better than nothing. Thanks for following up. :-)
I have also this issue, but escaping the $ doesn't change anything in the Markdown side:

:+1: on hoping for a fix here...it causes total havoc when trying to document anything in the PHP world :grimacing:
@aeromusek This should be fixed, yes, but I think you’re better off putting code in (inline) code blocks. This will display fine:
Read the `$_POST` to `$me`.
@uranusjr thanks for the follow-up. You're right — it's only fixed when the $ symbol is inside backticks.

Within code is fine, but the problem is when marking price $ 99.99.
Like @nhoizey, escaping does not solve the problem for me. I've actually started using the word 'dollars' after the number, when inline, or putting '(in dollars)' after the header for tables.
This is very frustrating to me. I have a document created with Mou, which causes the issues described here:

The thing is that if I copy that text into a new file, everything looks good:

The copy paste thing works sometimes. I think it starts to do weird things when there are multiple dollar signs into the same document,
I am also experiencing this issue. A lot of the Markdown that I write includes pricing information which makes the documents toggle between colors - somewhat negating the syntax highlighting feature.
Like @nhoizey and @rupe, escaping does not solve the problem for me. Similar to the workaround that @rupe proposed,I have started using USD instead of $ or $ but that is less than ideal.

Also experiencing the issue with price information in blog posts I attempt to write with MacDown.
I'm experiencing the same issue but I found a workaround.
I'm using the HTML number code $ for $.
@alienresident — Heh, good solution. :-)
So where are we on this? (And by "we", I of course mean "you". ;-) )
@Jmuccigr I just read through this thread. Among the three approaches:
bare dollar sign
MacDown doesn't work with this, but I don't think it' a good way to write bare dollar sign, because on many Markdown system that supports math with $, this will mess things up. It's difficult to decide whether a dollar sign means "the beginning of math" or "a plain dollar sign", for example in
Do you mean $14 or $40?
and in
Clearly $110_2 = 6_{10}$ (subscript for base in numeral system).
HTML entities
Works perfectly in MacDown, and will surely work in any editor/renderer. The code is not readable though.
escape by backslash
I like this approach and believe MacDown should support this. I didn't research much, but I believe most editors and renderers should work with it. Currently preview pane in MacDown works great, but syntax highlight fails (as noted by @nhoizey). I'm not familiar enough to code to decide whether it belongs to upstream (PEG in this case); I tried their sample Cocoa app, which doesn't seem to highlight math at all.
It's interesting to me that the renderer handles it fine (as does pandoc), while the editor doesn't. Clearly there's a fairly good algorithm for determining the difference between currency and math.
That said, surely MacDown should support \ escaping (everywhere?).
Clearly there's a fairly good algorithm for determining the difference between currency and math.
@Jmuccigr Did you mean the bare dollar sign or the escaped dollar sign?
Bare.
Then the MacDown renderer didn't handles it fine. I'll try Pandoc to see its behavior.
Pandoc restrict the conversion to math into
The opening
$must have a non-space character immediately to its right, while the closing$must have a non-space character immediately to its left, and must not be followed immediately by a digit. Thus,$20,000 and $30,000won’t parse as math.
Therefore
We know what $ E = m c^2 $ means.
won't work. By Pandoc's choice I guess very few users do this; if that's the case, we can just copy this behavior.
I may be confused here. :-) For me, the left side of a MacDown window (the editor, right?) doesn't handle the $ right, but the right side (the renderer, right?) does. This is with the tex-math option checked and $ as inline delimiter checked as well.
The pandoc rule seems pretty good to me. There are some edge cases, but supporting -escaping should handle those.
That's different from what I saw. My MacDown converts this
Do you mean $14 or $40?
into HTML
<p>Do you mean \(14 or \)40?</p>
which is rendered by MathJax as

Sorry, you're right.
I think I was observing the treatment of multiple $ in the text with tex-math off, not on. There the editor highlights the text, but the renderer leaves it alone.
BTW, it would be nice if the editor would not do any syntax highlighting when the tex-math option in the prefs is unchecked.
For what it’s worth, I think the need for a simple $ sign is probably greater than the need for Maths processing.
If I use $ for coding samples (such as for PHP or jQuery), I can wrap the expression in ticks or put it all in a code fence. If not, it shouldn’t be so complicated.