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

Bold/italic within characters like dashes is not properly rendered #64

Open
lexi-lambda opened this issue Jul 9, 2016 · 5 comments
Open

Comments

@lexi-lambda
Copy link
Contributor

The following example does not produce the HTML I would expect:

> (parse-markdown "This is a—*test*—with some—*em dash*—characters.")
'((p () "This is a—*test*—with some—*em dash*—characters."))

Most markdown implementations will treat the words surrounded by asterisks as italicized.

Notably, if I add some punctuation inside the dashes, the parse changes significantly:

> (parse-markdown "This is a—*test!*—with some—*em dash*—characters.")
'((p
   ()
   "This is a—*test!"
   (em () "—with some—*em dash")
   "—characters."))

Which still seems quite incorrect, but might be relevant.

@greghendershott
Copy link
Owner

This might be a duplicate of #55?

@lexi-lambda
Copy link
Contributor Author

Possibly; I’m not sure. My guess is that * adjacent to should not be considered to be “in the middle of words”, so I was wondering if there was some handling of that which was causing this behavior instead.

@greghendershott
Copy link
Owner

I'm not sure either. I mentioned #55 mostly because of the discussion there and why it's not resolved.

I like markdown. It meets my low expectations of it. :) Mostly it's pleasantly DWIM. When it's not? I've come to believe that "use some HTML markup to get exactly WIM" is the least-worst answer.

Maybe that's because I'm close to exhausting my finite lifetime quota of enthusiasm for resolving ambiguities and corner cases. Markdown doesn't have a real specification. Was never intended to.

I think CommonMark is an understandable response -- do make a real spec, which e.g. has 12 rules for this and 5 more rules for when the first 12 are still ambiguous. Great. But that's no longer markdown. I'm not super excited about using CommonMark, as a writer. Nor implementing a parser for it in Racket, even if I had time now, which I don't.

@lexi-lambda
Copy link
Contributor Author

Yeah, that’s fair! I certainly don’t blame you. I am mostly just reporting this because I ran into it, for completeness’s sake. If I find some time, I might look into fixing it, but otherwise I am fine for the official response to be “use HTML”.

Thanks for all the work you’ve put into this package, by the way—writing a Markdown parser does not seem like an easy feat.

@greghendershott
Copy link
Owner

You're welcome, and, thank you for the reporting it. I'm definitely interested in fixing problems generally.

Also I hope I didn't sound cranky about markdown or CommonMark. I admire John MacFarlane's determination.

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