diff --git a/resources/codemirror.mediawiki.js b/resources/codemirror.mediawiki.js index a4ab2b6d..bebb783f 100644 --- a/resources/codemirror.mediawiki.js +++ b/resources/codemirror.mediawiki.js @@ -819,9 +819,10 @@ class CodeMirrorModeMediaWiki { return this.eatList( stream, state ); case ':': // Highlight indented tables :{|, bug T108454 - if ( stream.match( /^:*[\s\u00a0]*{\|/, false ) ) { + if ( stream.match( /^:*[\s\u00a0]*(?={\|)/ ) ) { state.stack.push( state.tokenize ); state.tokenize = this.eatStartTable.bind( this ); + return mwModeConfig.tags.indenting; } return this.eatList( stream, state ); case ' ': diff --git a/tests/jest/codemirror.mediawiki.test.js b/tests/jest/codemirror.mediawiki.test.js index 5e5f5c6e..eb3c790c 100644 --- a/tests/jest/codemirror.mediawiki.test.js +++ b/tests/jest/codemirror.mediawiki.test.js @@ -24,8 +24,8 @@ const testCases = [ }, { title: 'indented table with caption and inline headings', - input: ':{|\n|}\n :: {| class="wikitable"\n |+ Caption\n |-\n ! Uno !! Dos\n |-\n | Foo || Bar\n |}', - output: '