idea-markdown icon indicating copy to clipboard operation
idea-markdown copied to clipboard

Support GitHub GFM Syntax Highlighting

Open taylorleese opened this issue 12 years ago • 37 comments

It would be great if you supported GitHub GFM syntax highlighting.

For example:

val foo = "bar"
<foo>bar</foo>

taylorleese avatar Sep 21 '11 07:09 taylorleese

+1

iron9light avatar Dec 29 '11 04:12 iron9light

+1

http://github.github.com/github-flavored-markdown/

I'm having issues with a bunch of Markdown files that are marked ```scala which makes previewing it tricky.

wsargent avatar Jan 01 '12 23:01 wsargent

+1

nodirt avatar Feb 19 '12 15:02 nodirt

Language injections in general would be very nice. Not just for the GFM, but also for PHP Markdown Extra style fenced code blocks and the variant supported by doxygen:

~~~{.php}
...php code here
~~~

tacovandenbroek avatar Mar 04 '12 13:03 tacovandenbroek

+1 Its so cool to wirte md-files for github directly in the IDE

psi-4ward avatar Jun 06 '12 15:06 psi-4ward

+1

ipetropolsky avatar Apr 12 '13 12:04 ipetropolsky

+1

arikon avatar Jul 24 '13 14:07 arikon

:+1:

ElijahLynn avatar Sep 27 '13 19:09 ElijahLynn

+1

marcoalbarelli avatar Oct 03 '13 09:10 marcoalbarelli

+1

jasoet avatar Oct 17 '13 16:10 jasoet

+1

aurelijusrozenas avatar Oct 28 '13 14:10 aurelijusrozenas

:+1:

carueda avatar Nov 25 '13 22:11 carueda

So what is missing exactly ? This plugin already has support for these Github extensions (from Pegdown docs):

  • HARDWRAPS: Alternative handling of newlines, see Github-flavoured-Markdown
  • AUTOLINKS: Plain (undelimited) autolinks the way Github-flavoured-Markdown implements them.
  • FENCED CODE BLOCKS: Fenced Code Blocks in the way of PHP Markdown Extra or Github-flavoured-Markdown.

You just have to enable it in the settings.

nicoulaj avatar Nov 30 '13 13:11 nicoulaj

@nicoulaj On GitHub, if I wanna insert plain-text code, I can surround my code in three tick marks above and below it and the code will be printed as plain text. On your plugin, I enabled the fenced code blocks feature, but I still can't do this for some reason.

(p.s. could you please add a keyboard shortcut to toggle preview/text? Thanks so much!!) :)

msafi avatar Jan 17 '14 15:01 msafi

:+1:

creynders avatar Feb 17 '14 12:02 creynders

:+1:

rayshan avatar Mar 17 '14 18:03 rayshan

:+1:

grosser avatar Apr 07 '14 19:04 grosser

Also task lists. * [ ] foo * [x] foo is a checkbox

  • [ ] foo
  • [x] foo

andrew-luhring avatar Apr 21 '14 17:04 andrew-luhring

:thumbsup:

jamarty avatar Apr 29 '14 16:04 jamarty

I don't suppose it would be possible to get those checkmarks AND the default github stylesheet integrated? So markdown files look like they're styled to look how they look on github?

andrew-luhring avatar Jun 11 '14 21:06 andrew-luhring

+1

maxwellpeterson-wf avatar Jul 31 '14 18:07 maxwellpeterson-wf

+1

lihuazhang avatar Aug 07 '14 12:08 lihuazhang

+1 !

florrain avatar Aug 13 '14 19:08 florrain

:+1:

mfn avatar Sep 26 '14 17:09 mfn

:+1:

andrew-luhring avatar Oct 04 '14 17:10 andrew-luhring

Just a thought, but GitHub does offer an API endpoint to render "GitHub flavored Markdown".

They also offer a Ruby Gem packaged for local reuse. This of course would require an embedded Ruby run-time - Koala, for example, has a minimal Ruby run-time embedded, which doesn't even bloat the distribution (much) and guarantees a safe, easy, direct upgrade-path to future versions of GitHub's Markdown.

I mean to suggest that there are much simpler/easier ways to get to full support for Markdown without relying on a third-party implementation. The number of users submitting +1's for GitHub Markdown suggest this may be what most users are longing for, although I suppose it's possible this project is aiming for broader/generic Markdown support? I don't know how you would address the potential number of proprietary Markdown extensions in practice though - might be better to just settle for one, the most popular one, if that's GitHub...

mindplay-dk avatar Nov 10 '14 14:11 mindplay-dk

afaik http://commonmark.org/ offers a c implementaion, maybe also java.

On Mon, Nov 10, 2014 at 6:39 AM, Rasmus Schultz [email protected] wrote:

Just a thought, but GitHub does offer an API endpoint https://developer.github.com/v3/markdown/ to render "GitHub flavored Markdown".

They also offer a Ruby Gem https://rubygems.org/gems/github-markdown packaged for local reuse. This of course would require an embedded Ruby run-time - Koala http://koala-app.com/, for example, has a minimal Ruby run-time embedded, which doesn't even bloat the distribution (much) and guarantees a safe, easy, direct upgrade-path to future versions of GitHub's Markdown.

I mean to suggest that there are much simpler/easier ways to get to full support for Markdown without relying on a third-party implementation. The number of users submitting +1's for GitHub Markdown suggest this may be what most users are longing for, although I suppose it's possible this project is aiming for broader/generic Markdown support? I don't know how you would address the potential number of proprietary Markdown extensions in practice though - might be better to just settle for one, the most popular one, if that's GitHub...

— Reply to this email directly or view it on GitHub https://github.com/nicoulaj/idea-markdown/issues/34#issuecomment-62392349 .

grosser avatar Nov 10 '14 15:11 grosser

afaik http://commonmark.org/ offers a c implementaion, maybe also java.

Again, you will be relying on a third party to keep up with any changes made to the official GitHub implementation, as well as (obviously) getting it right in the first place.

mindplay-dk avatar Nov 10 '14 15:11 mindplay-dk

I guess the most straightforward solution is to use the gem + jruby, but not sure it works, looks like this gem is not pure ruby: see github/markup#232

nicoulaj avatar Nov 10 '14 15:11 nicoulaj

looks like this gem is not pure ruby

Yeah, looks like the Ruby part is just a thin interface to a C library. That's probably a terrible idea then. Unless maybe it's possible to build the C library using Emscripten? Of course porting it would take some footwork.

Another thought is to let the browser do the work, e.g. using a JS library like marked which seems to have good support for GitHub flavor already.

mindplay-dk avatar Nov 10 '14 20:11 mindplay-dk

+1 for full GitHub flavored Markdown rendering, complete with correct styles.

And backticked blocks like this do not work reliably
or honor newlines inside of them
like this

DavidBoike avatar Nov 13 '14 18:11 DavidBoike

Hi @nicoulaj I would be up for looking into this if you could give me some guidance on the code.

nchelluri avatar Apr 03 '15 03:04 nchelluri

Even if you do not want to give up your own parser/renderer, and compatibility with other Markdown flavors, a 'GitHub option' would be quite useful. This option would simply override all other options and render as close as possible to GitHub flavored Markdown.

mhelvens avatar Apr 09 '15 16:04 mhelvens

FYI: Here you can find an up-to-date css file you can use:

https://github.com/sindresorhus/github-markdown-css

Pretty nifty. It is automatically generated from GitHub itself.

mhelvens avatar Apr 09 '15 17:04 mhelvens

+1

Tables also do not render as tables, no matter what is checked in the settings

Vampire avatar Jun 12 '15 01:06 Vampire

Notice: This plugin is no more maintained and it has been removed from Jetbrains plugins repository. There is a Markdown plugin officially supported by Jetbrains.

nicoulaj avatar May 22 '16 11:05 nicoulaj