[#5] Added sub/sup support for vars in documentation
parent
6452a239f3
commit
5999223c4e
|
@ -49,6 +49,19 @@ jqueryCheck( function()
|
|||
{
|
||||
hljs.highlightBlock( element, ' ' );
|
||||
} );
|
||||
|
||||
// quick-n-dirty sub and super script impl (it is by no means perfect)
|
||||
$( 'var:contains("\\")' ).each( function()
|
||||
{
|
||||
var $this = $( this );
|
||||
|
||||
$this.html(
|
||||
$this.html().replace( /(\\.*)$/, '<div>$1</div>' )
|
||||
.replace( /\\_([^ \\]+)/, '<sub>$1</sub>' )
|
||||
.replace( /\\\^([^ \\]+)/, '<sup>$1</sup>' )
|
||||
.replace( /(<\/su[bp]><su[bp])>/, '$1 class="left">' )
|
||||
);
|
||||
} );
|
||||
} );
|
||||
} );
|
||||
|
||||
|
|
|
@ -43,6 +43,27 @@ var {
|
|||
font-family: monospace;
|
||||
}
|
||||
|
||||
var div {
|
||||
position: relative;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
var sub, var sup {
|
||||
font-size: 0.75em;
|
||||
}
|
||||
|
||||
sup.left {
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
top: -0.75em;
|
||||
}
|
||||
|
||||
sub.left {
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
bottom: -0.2em;
|
||||
}
|
||||
|
||||
.float {
|
||||
border: 1px solid #babdb6;
|
||||
padding: 0px;
|
||||
|
|
Loading…
Reference in New Issue