Skip to content

Commit 16a27c7

Browse files
author
Szekeres Bálint
committed
tabulation fixes
1 parent fc2cdf4 commit 16a27c7

File tree

4 files changed

+12
-19
lines changed

4 files changed

+12
-19
lines changed

public/assets/css/app.css

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -102,18 +102,6 @@ main .file .code pre code {
102102
overflow-x: visible;
103103
}
104104

105-
main .file .code pre code span.include {
106-
white-space: pre-line;
107-
}
108-
109-
main .file .code pre code span.include ng-include {
110-
white-space: pre;
111-
}
112-
113-
main .file .code pre code ng-include {
114-
display: inline-block;
115-
}
116-
117105
footer {
118106
padding: 2rem 0 0.5rem;
119107
text-align: center;

public/assets/js/app.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,13 @@
135135
link: {
136136
pre: function preLink(scope, iElement, iAttrs, controller) {
137137
var tabs = parseInt(iAttrs.ngIncludeTabs || 0);
138-
controller.template = controller.template.replace(/^(.*)$/mg, '\t'.repeat(tabs) + '$1').replace(/\s*$/, '');
139-
console.log(controller);
138+
139+
var startRegex = new RegExp('\t'.repeat(tabs - 1));
140+
141+
controller.template = controller.template
142+
.replace(/^(.*)$/mg, '\t'.repeat(tabs) + '$1')
143+
.replace(startRegex, '')
144+
.replace(/\s*$/, '');
140145
},
141146
},
142147
};

public/templates/_php.conf.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
# handle .php
55
location ~ \.php$ {<span ng-if="data.file_structure === 'separated'">
66
include _php_fastcgi.conf;
7-
</span><span class="include" ng-if="data.file_structure === 'unified'">
8-
<ng-include ng-include-tabs="{{ data.file_structure === 'unified' ? 3 : 1 }}" src="'templates/_php_fastcgi.conf.html'" onload="refreshHighlighting()"></ng-include></span>
7+
</span><span ng-if="data.file_structure === 'unified'">
8+
<ng-include ng-include-tabs="{{ data.file_structure === 'unified' ? 3 : 1 }}" src="'templates/_php_fastcgi.conf.html'" onload="refreshHighlighting()"></ng-include></span>
99
}

public/templates/example.com.conf.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
include _wordpress.conf;</span><span ng-if="data.php !== 'off'">
2121
include _php.conf;</span>
2222
include _letsencrypt.conf;
23-
include _ssl.conf;</span><span class="include" ng-if="data.file_structure === 'unified'">
23+
include _ssl.conf;</span><span ng-if="data.file_structure === 'unified'">
2424
<ng-include ng-include-tabs="2" src="'templates/_general.conf.html'" onload="refreshHighlighting()"></ng-include><span ng-if="data.php !== 'off' && data.wordpress">
2525

2626
<ng-include ng-include-tabs="2" src="'templates/_wordpress.conf.html'" onload="refreshHighlighting()"></ng-include></span><span ng-if="data.php !== 'off'">
@@ -89,7 +89,7 @@
8989

9090
server_name {{ data.domain }} *.{{ data.domain }};
9191
<span ng-if="data.file_structure === 'separated'">
92-
include _letsencrypt.conf;</span><span class="include" ng-if="data.file_structure === 'unified'">
92+
include _letsencrypt.conf;</span><span ng-if="data.file_structure === 'unified'">
9393
<ng-include ng-include-tabs="2" src="'templates/_letsencrypt.conf.html'" onload="refreshHighlighting()"></ng-include></span>
9494

9595
return 301 https://{{ !data.non_www ? 'www.' : '' }}{{ data.domain }}$request_uri;
@@ -108,7 +108,7 @@
108108
<span ng-if="data.file_structure === 'separated'">
109109
include _general.conf;<span ng-if="data.php !== 'off' && data.wordpress">
110110
include _wordpress.conf;</span><span ng-if="data.php !== 'off'">
111-
include _php.conf;</span></span><span class="include" ng-if="data.file_structure === 'unified'">
111+
include _php.conf;</span></span><span ng-if="data.file_structure === 'unified'">
112112
<ng-include ng-include-tabs="2" src="'templates/_general.conf.html'" onload="refreshHighlighting()"></ng-include><span ng-if="data.php !== 'off' && data.wordpress">
113113

114114
<ng-include ng-include-tabs="2" src="'templates/_wordpress.conf.html'" onload="refreshHighlighting()"></ng-include></span><span ng-if="data.php !== 'off'">

0 commit comments

Comments
 (0)