Support of Highlight.js added to bootstrap-wysihtml5 editor

479 views
Skip to first unread message

Ruslan Konviser

unread,
Dec 3, 2012, 11:45:23 AM12/3/12
to highl...@googlegroups.com

I fork today bootstrap-wysihtml5 project and add code highlighting support using Highlight.js.

You can check demo at http://evereq.github.com/bootstrap-wysihtml5 and review source code at https://github.com/evereq/bootstrap-wysihtml5

Ivan Sagalaev

unread,
Dec 6, 2012, 11:06:00 PM12/6/12
to highl...@googlegroups.com
Hello Ruslan,

Thanks for the heads-up!

I looked over the sources and found one non-obvious issue ("issue" may
even be too strong a word). The `highlightBlock()` expects an element
with the code as the first parameter, which in your case should be
`<code>` while you pass the containing `<pre>` instead. It works
accidentally because highlight.js tries to preserve any user markup
withing the given container element and it does retain your `<code>` in
place. It probably will never break (even though I plan to rewrite that
part of code soon) but just for the sake of cleanliness, you might just
pass `<code>` as the first parameter to `highlightBlock()`.

Ruslan Konviser

unread,
Dec 9, 2012, 6:09:04 AM12/9/12
to highl...@googlegroups.com
Thanks Ivan, you are right and I fix code and commit changes to Github!
Thanks again for review of code and found how to improve it / fix bug :)

Best Regards, Ruslan

P.S. I use highlightJS with bootstrap-wysihtml5 on my latest project: pinlr.com (allows you for example to Pin / Discover / Organize github repos and much more... see http://www.pinlr.com/#evereq/evereq-bootstrap-wysihtml5 as example). Will very appreciate if you can provide some advice, your opinion is important for me. Thanks!

Ivan Sagalaev

unread,
Dec 13, 2012, 3:44:30 AM12/13/12
to highl...@googlegroups.com
> P.S. I use highlightJS with bootstrap-wysihtml5 on my latest project:
> pinlr.com (allows you for example to Pin / Discover / Organize github
> repos and much more... see
> http://www.pinlr.com/#evereq/evereq-bootstrap-wysihtml5 as
> example). Will very appreciate if you can provide some advice, your
> opinion is important for me. Thanks!

Can't promise to provide any comments but I'll keep that in mind and
have a look when/if times allows. Good luck with your project!
Reply all
Reply to author
Forward
0 new messages