File tree 3 files changed +11
-3
lines changed
3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ <h4 class="sg name">{{ mod.name | decodeHtml }}</h4>
29
29
ng-if ="!section.modifiers.length && section.markup "
30
30
ng-bind-html ="section.markup | setVariables: config.settings | unsafe " dynamic-compile >
31
31
</ div >
32
- < div ng-if ="section.markup && section.markup != 'false' ">
32
+ < div ng-if ="section.markup ">
33
33
< pre class ="sg " ng-show ="section.showMarkup ">
34
34
< span class ="toggle hide-markup " ng-show ="section.showMarkup " ng-click ="hideSingleMarkupBox($index) "> Hide markup</ span >
35
35
< code hljs source ="section.markup " class ="html "> </ code >
Original file line number Diff line number Diff line change @@ -243,7 +243,7 @@ function jsonSections(sections) {
243
243
deprecated : section . deprecated ( ) ,
244
244
experimental : section . experimental ( ) ,
245
245
reference : section . reference ( ) ,
246
- markup : section . markup ( ) . toString ( )
246
+ markup : section . markup ( ) ? section . markup ( ) . toString ( ) : null
247
247
}
248
248
} ) ;
249
249
}
@@ -255,7 +255,7 @@ function jsonModifiers(modifiers) {
255
255
name : modifier . name ( ) ,
256
256
description : sanitize ( modifier . description ( ) ) ,
257
257
className : modifier . className ( ) ,
258
- markup : modifier . markup ( ) . toString ( )
258
+ markup : modifier . markup ( ) ? modifier . markup ( ) . toString ( ) : null
259
259
}
260
260
} ) ;
261
261
}
Original file line number Diff line number Diff line change @@ -157,4 +157,12 @@ describe('styleguide.json', function() {
157
157
it ( 'should not reveal outputPath' , function ( ) {
158
158
should . not . exist ( jsonData . config . outputPath ) ;
159
159
} ) ;
160
+
161
+ it ( 'should print markup if defined' , function ( ) {
162
+ jsonData . sections [ 1 ] . markup . should . not . be . empty ;
163
+ } ) ;
164
+
165
+ it ( 'should not print empty markup' , function ( ) {
166
+ should . not . exist ( jsonData . sections [ 2 ] . markup ) ;
167
+ } ) ;
160
168
} ) ;
You can’t perform that action at this time.
0 commit comments