Index: src/main/java/org/xwiki/eclipse/ui/editors/Constants.java
===================================================================
--- src/main/java/org/xwiki/eclipse/ui/editors/Constants.java	(revision 25347)
+++ src/main/java/org/xwiki/eclipse/ui/editors/Constants.java	(working copy)
@@ -23,9 +23,34 @@
 public class Constants
 {
     public static final String LIST_BULLET_PATTERN =
-        "\\*+ |11*\\. |1\\**\\. |a\\. |A\\. |i\\. |I\\. |g\\. |h\\. |k\\. ";
+        // Bulleted list
+        "^\\*+ |"
+        // Numbered list
+        + "^1+\\. |"
+        // Mixed list
+        + "^1+\\*+\\. |"
+        // Square list
+        + "^- |"
+        // Lowercase Alphabetical list
+        + "^a\\. |"
+        // Uppercase Roman list
+        + "^A\\. |"
+        // Lowercase Greek list
+        + "^g\\. |"
+        // Uppercase Greek list
+        + "^G\\. |"
+        // Hiragana list
+        + "^h\\. |"
+        // Hiragana Iroah list
+        + "^H\\. |"
+        // Katakana list
+        + "^k\\. |"
+        // Katakana Iroha list
+        + "^K\\. |"
+        // Hebrew list
+        + "^j\\. ";
 
-    public static final String DEFINITION_TERM_PATTERN = ":*; .+|:+ .+";
+    public static final String DEFINITION_TERM_PATTERN = ":*; |:+ ";
 
     public static final String API_DATA_DIRECTORY = "xwikiApi";
 }
Index: src/main/java/org/xwiki/eclipse/ui/editors/scanners/rules/Rule.java
===================================================================
--- src/main/java/org/xwiki/eclipse/ui/editors/scanners/rules/Rule.java	(revision 0)
+++ src/main/java/org/xwiki/eclipse/ui/editors/scanners/rules/Rule.java	(revision 0)
@@ -0,0 +1,108 @@
+/*
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *
+ */
+package org.xwiki.eclipse.ui.editors.scanners.rules;
+
+import org.eclipse.jface.text.rules.ICharacterScanner;
+import org.eclipse.jface.text.rules.IRule;
+
+public abstract class Rule implements IRule
+{
+    private static final char[] LINE_SEPARATOR = System.getProperty("line.separator").toCharArray();
+
+    protected StringBuffer readLeadingSpaces(ICharacterScanner scanner)
+    {
+        StringBuffer spaces = new StringBuffer();
+
+        int c;
+        while ((c = scanner.read()) != ICharacterScanner.EOF && isSpace(c)) {
+            spaces.append((char) c);
+        }
+
+        // Rewind the last character.
+        scanner.unread();
+        return spaces;
+    }
+
+    private boolean isSpace(int c)
+    {
+        return ((char) c) == ' ' || ((char) c) == '\t';
+    }
+
+    protected StringBuffer readWord(ICharacterScanner scanner)
+    {
+        StringBuffer word = new StringBuffer();
+
+        int c;
+        while ((c = scanner.read()) != ICharacterScanner.EOF) {
+            word.append((char) c);
+
+            if (Character.isWhitespace(c)) {
+                return word;
+            }
+        }
+
+        // Rewind the EOF.
+        scanner.unread();
+        return word;
+    }
+
+    protected StringBuffer readLine(ICharacterScanner scanner)
+    {
+        StringBuffer line = new StringBuffer();
+
+        do {
+            char[] separator = readLineSeparatorIfPresent(scanner);
+            if (separator != null) {
+                line.append(separator);
+                return line;
+            }
+
+            int c = scanner.read();
+            if (c == ICharacterScanner.EOF) {
+                break;
+            }
+
+            line.append((char) c);
+        } while (true);
+
+        // Rewind EOF.
+        scanner.unread();
+        return line;
+    }
+
+    private char[] readLineSeparatorIfPresent(ICharacterScanner scanner)
+    {
+        for (int n = 0; n < LINE_SEPARATOR.length; n++) {
+            if (LINE_SEPARATOR[n] != (char) scanner.read()) {
+                unread(scanner, n + 1);
+                return null;
+            }
+        }
+        return LINE_SEPARATOR;
+    }
+
+    protected void unread(ICharacterScanner scanner, int count)
+    {
+        for (int n = 0; n < count; n++) {
+            scanner.unread();
+        }
+    }
+}
Index: src/main/java/org/xwiki/eclipse/ui/editors/scanners/rules/HeaderRule.java
===================================================================
--- src/main/java/org/xwiki/eclipse/ui/editors/scanners/rules/HeaderRule.java	(revision 0)
+++ src/main/java/org/xwiki/eclipse/ui/editors/scanners/rules/HeaderRule.java	(revision 0)
@@ -0,0 +1,75 @@
+/*
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *
+ */
+package org.xwiki.eclipse.ui.editors.scanners.rules;
+
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.jface.text.rules.ICharacterScanner;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.Token;
+
+public class HeaderRule extends Rule
+{
+    private Map<Pattern, IToken> tokenLookup = new LinkedHashMap<Pattern, IToken>();
+
+    public IToken evaluate(ICharacterScanner scanner)
+    {
+        if (scanner.getColumn() != 0) {
+            return Token.UNDEFINED;
+        }
+
+        // Consume all leading spaces.
+        StringBuffer spaces = readLeadingSpaces(scanner);
+
+        // Consume the first two words.
+        StringBuffer text = readWord(scanner);
+        text.append(readWord(scanner));
+
+        Iterator<Pattern> patterns = tokenLookup.keySet().iterator();
+        while (patterns.hasNext()) {
+            Pattern pattern = patterns.next();
+            if (pattern == null) {
+                continue;
+            }
+
+            // Is there a headline?
+            Matcher matcher = pattern.matcher(text);
+            if (matcher.lookingAt()) {
+                // Yes. Consume the rest of the line.
+                readLine(scanner);
+                return tokenLookup.get(pattern);
+            }
+        }
+
+        // There is no headline. Rewind the scanner.
+        unread(scanner, spaces.length() + text.length());
+        return Token.UNDEFINED;
+    }
+
+    public void add(String regex, IToken token)
+    {
+        tokenLookup.put(Pattern.compile(regex), token);
+    }
+}
Index: src/main/java/org/xwiki/eclipse/ui/editors/scanners/rules/DefinitionListRule.java
===================================================================
--- src/main/java/org/xwiki/eclipse/ui/editors/scanners/rules/DefinitionListRule.java	(revision 0)
+++ src/main/java/org/xwiki/eclipse/ui/editors/scanners/rules/DefinitionListRule.java	(revision 0)
@@ -0,0 +1,48 @@
+/*
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *
+ */
+package org.xwiki.eclipse.ui.editors.scanners.rules;
+
+import org.eclipse.jface.text.rules.ICharacterScanner;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.Token;
+
+public class DefinitionListRule extends ListRule
+{
+    public DefinitionListRule(String regex, IToken token)
+    {
+        super(regex, token);
+    }
+
+    @Override
+    public IToken evaluate(ICharacterScanner scanner)
+    {
+        IToken token = super.evaluate(scanner);
+        // Is there a definition list?
+        if (token == Token.UNDEFINED) {
+            // No.
+            return token;
+        }
+
+        // Yes. Consume the rest of the line.
+        readLine(scanner);
+        return token;
+    }
+}
Index: src/main/java/org/xwiki/eclipse/ui/editors/scanners/rules/ListRule.java
===================================================================
--- src/main/java/org/xwiki/eclipse/ui/editors/scanners/rules/ListRule.java	(revision 0)
+++ src/main/java/org/xwiki/eclipse/ui/editors/scanners/rules/ListRule.java	(revision 0)
@@ -0,0 +1,64 @@
+/*
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *
+ */
+package org.xwiki.eclipse.ui.editors.scanners.rules;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.jface.text.rules.ICharacterScanner;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.Token;
+
+public class ListRule extends Rule
+{
+    private Pattern pattern;
+    private IToken token;
+
+    public ListRule(String regex, IToken token)
+    {
+        this.pattern = Pattern.compile(regex);
+        this.token = token;
+    }
+
+    public IToken evaluate(ICharacterScanner scanner)
+    {
+        if (scanner.getColumn() != 0) {
+            return Token.UNDEFINED;
+        }
+
+        // Consume all leading spaces.
+        StringBuffer spaces = readLeadingSpaces(scanner);
+
+        // Consume the first word.
+        StringBuffer text = readWord(scanner);
+
+        // Is there a list?
+        Matcher matcher = pattern.matcher(text);
+        if (matcher.lookingAt()) {
+            // Yes.
+            return token;
+        }
+
+        // There is no list. Rewind the scanner.
+        unread(scanner, spaces.length() + text.length());
+        return Token.UNDEFINED;
+    }
+}
Index: src/main/java/org/xwiki/eclipse/ui/editors/scanners/XWikiMarkupScanner.java
===================================================================
--- src/main/java/org/xwiki/eclipse/ui/editors/scanners/XWikiMarkupScanner.java	(revision 25347)
+++ src/main/java/org/xwiki/eclipse/ui/editors/scanners/XWikiMarkupScanner.java	(working copy)
@@ -31,7 +31,9 @@
 import org.xwiki.eclipse.ui.editors.Constants;
 import org.xwiki.eclipse.ui.editors.Preferences;
 import org.xwiki.eclipse.ui.editors.scanners.rules.BalancedParenthesisRule;
-import org.xwiki.eclipse.ui.editors.scanners.rules.RegExRule;
+import org.xwiki.eclipse.ui.editors.scanners.rules.DefinitionListRule;
+import org.xwiki.eclipse.ui.editors.scanners.rules.HeaderRule;
+import org.xwiki.eclipse.ui.editors.scanners.rules.ListRule;
 
 public class XWikiMarkupScanner extends RuleBasedScanner
 {
@@ -63,62 +65,17 @@
 
         List<IRule> rules = new ArrayList<IRule>();
 
-        /* RegEx rules work better with respect to SingleLineRules */
-        RegExRule regExRule = new RegExRule("1 .*\n?", heading1Token);
-        regExRule.setColumnConstraint(0);
-        rules.add(regExRule);
-
-        regExRule = new RegExRule("= .*\n?", heading1Token);
-        regExRule.setColumnConstraint(0);
-        rules.add(regExRule);
-
-        regExRule = new RegExRule("1.1 .*\n?", heading2Token);
-        regExRule.setColumnConstraint(0);
-        rules.add(regExRule);
-
-        regExRule = new RegExRule("== .*\n?", heading1Token);
-        regExRule.setColumnConstraint(0);
-        rules.add(regExRule);
-
-        regExRule = new RegExRule("1.1.1 .*\n?", heading3Token);
-        regExRule.setColumnConstraint(0);
-        rules.add(regExRule);
-
-        regExRule = new RegExRule("=== .*\n?", heading1Token);
-        regExRule.setColumnConstraint(0);
-        rules.add(regExRule);
-
-        regExRule = new RegExRule("1.1.1.1 .*\n?", heading4Token);
-        regExRule.setColumnConstraint(0);
-        rules.add(regExRule);
-
-        regExRule = new RegExRule("==== .*\n?", heading1Token);
-        regExRule.setColumnConstraint(0);
-        rules.add(regExRule);
-
-        regExRule = new RegExRule("1.1.1.1.1 .*\n?", heading5Token);
-        regExRule.setColumnConstraint(0);
-        rules.add(regExRule);
-
-        regExRule = new RegExRule("===== .*\n?", heading1Token);
-        regExRule.setColumnConstraint(0);
-        rules.add(regExRule);
-
-        regExRule = new RegExRule("1.1.1.1.1.1 .*\n?", heading6Token);
-        regExRule.setColumnConstraint(0);
-        rules.add(regExRule);
+        HeaderRule headers = new HeaderRule();
+        headers.add("^= .|^1 .", heading1Token);
+        headers.add("^== .|^1\\.1 .", heading2Token);
+        headers.add("^=== .|^1\\.1\\.1 .", heading3Token);
+        headers.add("^==== .|^1\\.1\\.1\\.1 .", heading4Token);
+        headers.add("^===== .|^1\\.1\\.1\\.1\\.1 .", heading5Token);
+        headers.add("^====== .|^1\\.1\\.1\\.1\\.1\\.1 .", heading6Token);
+        rules.add(headers);
 
-        regExRule = new RegExRule("====== .*\n?", heading1Token);
-        regExRule.setColumnConstraint(0);
-        rules.add(regExRule);
-
-        regExRule = new RegExRule(Constants.LIST_BULLET_PATTERN, listBulletToken);
-        regExRule.setColumnConstraint(0);
-        rules.add(regExRule);
-
-        regExRule = new RegExRule(Constants.DEFINITION_TERM_PATTERN, definitionTermToken);
-        regExRule.setColumnConstraint(0);
-        rules.add(regExRule);
+        rules.add(new ListRule(Constants.LIST_BULLET_PATTERN, listBulletToken));
+        rules.add(new DefinitionListRule(Constants.DEFINITION_TERM_PATTERN, definitionTermToken));
 
         rules.add(new SingleLineRule("**", "**", boldToken, '\\'));
         rules.add(new SingleLineRule("*", "*", boldToken, '\\'));
