3 ms·
You can skip having to escape any characters or worry if the content is correct, if you put an unformatted git log into a script tag, and then line split and se
by dahart 9y ago
You can skip having to escape any characters or worry if the content is correct, if you put an unformatted git log into a script tag, and then line split and set the content of each element via a JS call.
I just tried it, and it works beautifully, no problems with illegal characters.
What's wrong with this? It'd be super easy to extend if you want columns or colors or links...
<script id='gitlog' type='text'>
c0c3150f5 09 - 15 dahart Color widget!, #1 improving < hsv > && things [Finishes #8736345] \m/ '",.;:%$#@*
</script>
<div id='lines'></div>
$('#gitlog').html().split('\n').forEach(line => {
$('#lines').append($('<div class="line"/>').text(line))
})