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

Syntax hightlight

Open gagarine opened this issue 12 years ago • 3 comments

When you edit it would be very cool if the text would be hightlighted. For example when you add a title the text can be a little bit stronger. This will help to see the structure of the text.

Very nice editor thanks.

gagarine avatar Jun 13 '13 12:06 gagarine

:+1:

steverob avatar Jan 03 '14 09:01 steverob

I think you can integrate CodeMirror to the textarea. A nice implementation of CodeMirror on MarkDown: http://jbt.github.io/markdown-editor/

lodev09 avatar May 15 '14 00:05 lodev09

Forget about my last comment, I was working on the highlight and I found marked (as your parser) can do this using highlightjs.

Put this somewhere on your script (make sure highlightjs and marked are loaded):

marked.setOptions({
    sanitize: false,
    highlight: function (code) {
        return hljs.highlightAuto(code).value;
    },
    breaks: true
});

More info: https://github.com/chjj/marked#highlight

lodev09 avatar Aug 07 '14 18:08 lodev09