mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-11-23 13:56:44 +00:00
Merge "improve treatment of lists at start of line"
This commit is contained in:
commit
84d88b1f4e
2
resources/dist/main.js
vendored
2
resources/dist/main.js
vendored
File diff suppressed because one or more lines are too long
2
resources/dist/main.js.map.json
vendored
2
resources/dist/main.js.map.json
vendored
File diff suppressed because one or more lines are too long
|
@ -513,7 +513,7 @@ class CodeMirrorModeMediaWiki {
|
|||
}
|
||||
// eat &
|
||||
stream.next();
|
||||
return this.eatHtmlEntity( stream );
|
||||
return this.eatHtmlEntity( stream, '' );
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -782,8 +782,9 @@ class CodeMirrorModeMediaWiki {
|
|||
break;
|
||||
case '*':
|
||||
case '#':
|
||||
case ';':
|
||||
// Just consume all nested list and indention syntax when there is more
|
||||
stream.match( /^[*#]*:*/ );
|
||||
stream.match( /^[*#;:]*/ );
|
||||
return modeConfig.tags.list;
|
||||
case ':':
|
||||
// Highlight indented tables :{|, bug T108454
|
||||
|
@ -792,7 +793,7 @@ class CodeMirrorModeMediaWiki {
|
|||
state.tokenize = this.eatStartTable.bind( this );
|
||||
}
|
||||
// Just consume all nested list and indention syntax when there is more
|
||||
stream.match( /^:*[*#]*/ );
|
||||
stream.match( /^[*#;:]*/ );
|
||||
return modeConfig.tags.indenting;
|
||||
case ' ':
|
||||
// Leading spaces is valid syntax for tables, bug T108454
|
||||
|
|
|
@ -88,6 +88,11 @@ const testCases = [
|
|||
input: '* bullet A\n* bullet B\n# one\n # two',
|
||||
output: '<div class="cm-line"><span class="cm-mw-list">*</span> bullet A</div><div class="cm-line"><span class="cm-mw-list">*</span> bullet B</div><div class="cm-line"><span class="cm-mw-list">#</span> one</div><div class="cm-line"><span class="cm-mw-skipformatting"> </span># two</div>'
|
||||
},
|
||||
{
|
||||
title: 'nested ordered, unordered and definition lists',
|
||||
input: '*#;: item A\n#;:* item B\n;:*# item C\n:*#; item D',
|
||||
output: '<div class="cm-line"><span class="cm-mw-list">*#;:</span> item A</div><div class="cm-line"><span class="cm-mw-list">#;:*</span> item B</div><div class="cm-line"><span class="cm-mw-list">;:*#</span> item C</div><div class="cm-line"><span class="cm-mw-indenting">:*#;</span> item D</div>'
|
||||
},
|
||||
{
|
||||
title: 'link with bold text',
|
||||
input: '[[Link title|\'\'\'bold link\'\'\']]',
|
||||
|
|
Loading…
Reference in a new issue