Infragistics / livewire

A simple web content editor built with Electron
https://waffle.io/infragistics/livewire
19 stars 9 forks source link

Syntax highlighting for code within fenced code block #69

Closed samelliottdlt closed 2 years ago

samelliottdlt commented 8 years ago

Syntax highlighting for code within a fenced code block similar to what GitHub currently does.

Currently code blocks written in Livewire will look like this:

const lessThanTen = data =>  {

    this.value = 10;

    let result = [];

    return data.filter( element => element > this.value );
}

While GitHub's markdown supports syntax highlighting for some programming languages by adding the language of choice after the three back ticks:

const lessThanTen = data =>  {

    this.value = 10;

    let result = [];

    return data.filter( element => element > this.value );
}

Relevant info: https://github.com/github/linguist http://prismjs.com/

ig-ealbert commented 8 years ago

I think we have this feature in Tripwire, as the code snippets in the Ignite UI help have syntax highlighting with this same method (language after 3 backticks). Guess this request is to somehow have that shown in the preview? If not, then it's already done by Tripwire.

samelliottdlt commented 8 years ago

Correct, when I wrote this up I was thinking of having syntax highlighting visible in the preview pane of Livewire.