Intentional indentation and newlines
This commit is contained in:
@@ -53,23 +53,18 @@
|
||||
</form>
|
||||
<pre><code id="example-source" class="language-markup"><!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{{ title }}</title>
|
||||
<link rel="stylesheet" href="http://openlayers.org/en/v{{ olVersion }}/css/ol.css" type="text/css">
|
||||
<script src="http://openlayers.org/en/v{{ olVersion }}/build/ol.js"></script>
|
||||
{{ extraHead.remote }}
|
||||
{{#if css.source}}
|
||||
<style>
|
||||
{{ css.source }}
|
||||
</style>
|
||||
{{/if}}
|
||||
</head>
|
||||
<body>
|
||||
{{ contents }}
|
||||
<script>
|
||||
{{ js.source }}
|
||||
</script>
|
||||
</body>
|
||||
<head>
|
||||
<title>{{ title }}</title>
|
||||
<link rel="stylesheet" href="http://openlayers.org/en/v{{ olVersion }}/css/ol.css" type="text/css">
|
||||
<script src="http://openlayers.org/en/v{{ olVersion }}/build/ol.js"></script>{{#if extraHead.remote}}
|
||||
{{ indent extraHead.remote spaces=4 }}{{/if}}{{#if css.source}}
|
||||
<style>
|
||||
{{ indent css.source spaces=6 }} </style>{{/if}}
|
||||
</head>
|
||||
<body>
|
||||
{{ indent contents spaces=4 }} <script>
|
||||
{{ indent js.source spaces=6 }} </script>
|
||||
</body>
|
||||
</html></code></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -233,6 +233,16 @@ function main(callback) {
|
||||
helpers: {
|
||||
md: function(str) {
|
||||
return new handlebars.SafeString(marked(str));
|
||||
},
|
||||
indent: function(text, options) {
|
||||
if (!text) {
|
||||
return text;
|
||||
}
|
||||
var count = options.hash.spaces || 2;
|
||||
var spaces = new Array(count + 1).join(' ');
|
||||
return text.split('\n').map(function(line) {
|
||||
return line ? spaces + line : '';
|
||||
}).join('\n');
|
||||
}
|
||||
}
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user