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

Accept info strings in code fences #448

Merged
merged 3 commits into from
Apr 28, 2018

Conversation

garfieldnate
Copy link
Contributor

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).

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.
@garfieldnate
Copy link
Contributor Author

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!

@rtfb
Copy link
Collaborator

rtfb commented Apr 23, 2018

Sorry, I don't understand the build failures. Looks like a diff command is failing...

This is a formatting checker failing, it says that go fmt produces non-empty output. Run go fmt on your branch and commit whatever it fixes.

@garfieldnate
Copy link
Contributor Author

Done!

}

// Test if a character is a horizontal whitespace character.
func ishorizontalspace(c byte) bool {
Copy link
Collaborator

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).

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Collaborator

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.

@rtfb rtfb merged commit 11635eb into russross:master Apr 28, 2018
@garfieldnate garfieldnate deleted the fix_codefence_info_string_parsing branch April 29, 2018 07:30
@garfieldnate
Copy link
Contributor Author

garfieldnate commented Apr 29, 2018

Thanks! Looking forward to the release :)

willdollman pushed a commit to willdollman/blackfriday that referenced this pull request Feb 27, 2021
* 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
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

Successfully merging this pull request may close these issues.

2 participants