-
Notifications
You must be signed in to change notification settings - Fork 600
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
Accept info strings in code fences #448
Accept info strings in code fences #448
Conversation
According to the common mark standard, code fence info strings can be anything, not just single words. Update the tests and parser accordingly. The formatter already expected an info string with a language and HTML classes, so this does not need to change. Update the LaTeX formatter to take the first word of the info string as the language. Fixes russross#410 (in v1).
This follows the common mark specification.
Sorry, I don't understand the build failures. Looks like a diff command is failing... Anyway, let me know if you need me to redo or change anything. Cheers! |
This is a formatting checker failing, it says that |
Done! |
} | ||
|
||
// Test if a character is a horizontal whitespace character. | ||
func ishorizontalspace(c byte) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor nit: I think it would make sense to get rid of the C-like naming, let's change that to isHorizontalSpace
(and same for vertical).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. For this PR, though, I kept the style consistent with what's already in there. Fixing the style everywhere would be a separate task/commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you would like me to fix it in another commit, though, I can. I would really like both of these PR's merged as soon as possible so I can start working on Hugo again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only meant these two new funcs, but it's a minor nit anyway, so in it goes! Shoot the other PR if you feel up to that.
Thanks! Looking forward to the release :) |
* Accept info strings in code fences According to the common mark standard, code fence info strings can be anything, not just single words. Update the tests and parser accordingly. The formatter already expected an info string with a language and HTML classes, so this does not need to change. Update the LaTeX formatter to take the first word of the info string as the language. Fixes russross#410 (in v1). * Don't output whole info string as code classes This follows the common mark specification. * run go fmt
According to the common mark standard, code fence info strings can be anything,
not just single words. Update the tests and parser accordingly.
The formatter already expected an info string with a language and HTML classes,
so this does not need to change. Update the LaTeX formatter to take the first
word of the info string as the language.
Fixes #410 (in v1).