File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -16,14 +16,14 @@ const checkbox = (args) => {
1616
1717 const checked = ( args [ 1 ] || '' ) . length > 0 && args [ 1 ] . trim ( ) !== 'false' ;
1818 const inline = ( args [ 2 ] || '' ) . length > 0 && args [ 2 ] . trim ( ) !== 'false' ;
19- const enabled = ( args [ 3 ] || '' ) . length > 0 && args [ 3 ] . trim ( ) = == 'false' ;
19+ const disabled = ( args [ 3 ] || '' ) . length > 0 && args [ 3 ] . trim ( ) ! == 'false' ;
2020
2121 return `${ ! inline ? '<div>' : '' }
22- <input type="checkbox" ${ enabled ? '' : 'disabled ' } ${ checked ? 'checked="checked"' : '' } >${ text }
22+ <input type="checkbox" ${ disabled ? 'disabled ' : '' } ${ checked ? 'checked="checked"' : '' } >${ text }
2323 ${ ! inline ? '</div>' : '' } ` ;
2424
2525} ;
2626
27- // {% cb text, checked?, inline? %}
27+ // {% cb text, checked?, inline?, disabled? %}
2828hexo . extend . tag . register ( 'checkbox' , checkbox , { ends : false } ) ;
2929hexo . extend . tag . register ( 'cb' , checkbox , { ends : false } ) ;
You can’t perform that action at this time.
0 commit comments