Skip to content
This repository has been archived by the owner on Dec 11, 2017. It is now read-only.

Commit

Permalink
Fix passing of linting options
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Sep 12, 2017
1 parent b6092bb commit 02116b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions wp-admin/js/code-editor.js
Expand Up @@ -61,17 +61,17 @@ if ( 'undefined' === typeof window.wp.codeEditor ) {
}

// Configure JSHint.
if ( 'javascript' === lintOptions.mode && settings.jshint ) {
if ( 'javascript' === settings.codemirror.mode && settings.jshint ) {
$.extend( lintOptions.options, settings.jshint );
}

// Configure CSSLint.
if ( 'css' === lintOptions.mode && settings.csslint ) {
if ( 'css' === settings.codemirror.mode && settings.csslint ) {
$.extend( lintOptions.options, settings.csslint );
}

// Configure HTMLHint.
if ( 'htmlmixed' === lintOptions.mode && settings.htmlhint ) {
if ( 'htmlmixed' === settings.codemirror.mode && settings.htmlhint ) {
lintOptions.options.rules = $.extend( {}, settings.htmlhint );

if ( settings.jshint ) {
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/general-template-addendum.php
Expand Up @@ -218,7 +218,7 @@ function wp_enqueue_code_editor( $args ) {
) );

if ( ! current_user_can( 'unfiltered_html' ) ) {
$settings['htmlhint']['rules']['kses'] = wp_kses_allowed_html( 'post' );
$settings['htmlhint']['kses'] = wp_kses_allowed_html( 'post' );
}
} elseif ( 'text/x-gfm' === $type ) {
$settings['codemirror'] = array_merge( $settings['codemirror'], array(
Expand Down

0 comments on commit 02116b2

Please sign in to comment.