From 86ea8ad835f323721468395dbfa289846b856dbe Mon Sep 17 00:00:00 2001 From: Erik Osheim Date: Mon, 14 Jan 2013 00:14:30 -0500 Subject: [PATCH] improve markdown --HG-- branch : pmacs2 --- mode/markdown.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mode/markdown.py b/mode/markdown.py index 868754c..6cd6a4b 100644 --- a/mode/markdown.py +++ b/mode/markdown.py @@ -18,6 +18,11 @@ LineGrammar.rules = [ PatternRule('eol', r'\n'), ] +class WordGrammar(Grammar): pass +WordGrammar.rules = [ + PatternRule('word', r'[A-Za-z0-9_]+'), +] + class MarkdownGrammar(Grammar): pass MarkdownGrammar.rules = [ PatternRule('md.head1', r'^#.+'), @@ -56,7 +61,7 @@ MarkdownGrammar.rules = [ RegionRule('md.tt', r'``', MarkdownGrammar, r'``'), RegionRule('md.bold', r'\*', MarkdownGrammar, r'\*'), - RegionRule('md.tt', r'`', MarkdownGrammar, r'`'), + RegionRule('md.tt', r'`', WordGrammar, r'`'), PatternRule('md.escaped', r'\\.'), PatternRule('md.word', r'[a-zA-Z\'"\-]+'), @@ -145,6 +150,7 @@ class Markdown(Fundamental): 'md.bold.end': hi_orange, 'md.tt.start': lo_orange, + 'md.tt.word': lo_orange, 'md.tt.null': lo_orange, 'md.tt.md.word': lo_orange, 'md.tt.end': lo_orange,