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

Enforcing Kramdown and Rouge breaks PHP syntax highlighting #205

Closed
alyssais opened this issue Feb 10, 2016 · 8 comments
Closed

Enforcing Kramdown and Rouge breaks PHP syntax highlighting #205

alyssais opened this issue Feb 10, 2016 · 8 comments
Labels
bug

Comments

@alyssais
Copy link

@alyssais alyssais commented Feb 10, 2016

Pygments supports a special PHP syntax highlighting option called startinline. It instructs the highlighter to begin interpreting code as PHP immediately, rather than waiting for an opening <?php tag.

It's used like this:

{% highlight php startinline %}
echo "Hello, world!";
{% end %}

Rouge also supports this, but the syntax is a little different:

```php?start_inline=1
echo "Hello, world!";
```

So far, so good — as long as your markdown parser is Redcarpet.

Kramdown's parser messes up, and will interpret the above code as a fenced code block with no language specified, the first line of which is php?start_inline=1.

This means that, unless something changes, after 1 May startinline syntax highlighting will disappear from GitHub Pages.

The only way to solve this without removing the Kramdown-enforcement, as I can see it, is

  1. Get Kramdown's parser fixed (gettalong/kramdown#234)
  2. Get a new version of Kramdown released
  3. Get a new version of Jekyll released with the Kramdown dependency. (Bear in mind the last down Jekyll updated the version of Kramdown it depended on was in 2014 — there have been six 1.x released since then.)
  4. Upgrade GitHub Pages to the new version of Jekyll

This seems unlikely to all be accomplished by May 1.

So, the only way to avoid a regression in GitHub Pages is likely to be postponing the date Kramdown enforcement begins.

@benbalter
Copy link
Contributor

@benbalter benbalter commented Feb 10, 2016

. (Bear in mind the last down Jekyll updated the version of Kramdown it depended on was in 2014 — there have been six 1.x released since then.)

GitHub Pages (and thus Jekyll) is using Kramdown 1.9.0. Is that not the latest release?

Upgrade GitHub Pages to the new version of Jekyll

Which version are you referring to? (We're currently running 3.0.3). Do you have a link to an issue where this bug was fixed?

@alyssais
Copy link
Author

@alyssais alyssais commented Feb 10, 2016

Okay, sorry about that, I misread Jekyll's gemspec.

In that case, all that needs to happen is for Kramdown to fix the issue, release a new version and for GitHub Pages to update to the new version of Kramdown.

That seems far more doable, although the Kramdown issue was opened almost a year ago and it doesn't look like much has happened since then…

@svivian
Copy link

@svivian svivian commented Feb 19, 2016

+1

@gettalong
Copy link

@gettalong gettalong commented Feb 19, 2016

This is now fixed in kramdown.

@parkr parkr added the bug label Feb 19, 2016
@parkr
Copy link
Member

@parkr parkr commented Feb 19, 2016

kramdown commit: gettalong/kramdown@0f4d1ff & issue: gettalong/kramdown#234

@gettalong Let us know what your plans are for a new release and we can coordinate on bumping it.

@gettalong
Copy link

@gettalong gettalong commented Feb 19, 2016

@parkr I will probably release a new version at the end of next week.

@mmoll
Copy link

@mmoll mmoll commented Mar 5, 2016

@alyssais
Copy link
Author

@alyssais alyssais commented Mar 10, 2016

This appears to have been fixed in #230. 👍

@alyssais alyssais closed this Mar 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.