S
S
sirlexaiv2016-01-12 14:42:43
Habr
sirlexaiv, 2016-01-12 14:42:43

Is it possible for a reader of articles on Habré to do code syntax highlighting, or can this be done only when writing an article?

Please tell me in most of the articles on Habré the program code is presented. Part of it is backlit, part is not backlit and in font color format, etc. For example:

<font size="2" face="Courier New" color="black"><?php<br> require_once <font color="#A31515">'PHPUnit/Framework.php'</font>;<br> <br> <font color="#0000ff">class</font> StackTest extends PHPUnit_Framework_TestCase<br> {<br>     <font color="#0000ff">public</font> function testPushAndPop()<br>     {<br>         $stack = array();<br>         $<font color="#0000ff">this</font>->assertEquals(0, count($stack));<br> <br>        array_push($stack, <font color="#A31515">'foo'</font>);<br>         $<font color="#0000ff">this</font>->assertEquals(<font color="#A31515">'foo'</font>, $stack[count($stack)-1]);<br>         $<font color="#0000ff">this</font>->assertEquals(1, count($stack));<br> <br>        $<font color="#0000ff">this</font>->assertEquals(<font color="#A31515">'foo'</font>, array_pop($stack));<br>

is it possible to improve the readability of this (you need highlighting and display without html tags)
so far only one option is available: copying to an html file and previewing in the browser. There are other options, maybe some plugins. in general, to make it easier to read articles on Habré with code?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DDDsa, 2016-01-12
@sirlexaiv

Plugin for Firefox , only it's not very good. The code is displayed in a separate window and is not very beautiful, there are not enough languages.
Well, you can also copy here:
Syntax Highlighter
jsfiddle.net
Option from the author of the question: Coding Ground

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question