Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a lexer for emails #1567

Merged
merged 7 commits into from
Oct 13, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add support for quoted lines
  • Loading branch information
pyrmont committed Sep 8, 2020
commit 98c03dcce076e7e60ec895a2ded86480809f46c0
3 changes: 2 additions & 1 deletion lib/rouge/lexers/email.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ class Email < RegexLexer
end

state :root do
rule %r/.*/m, Text
rule %r/^>.*/, Comment
rule %r/.*/, Text
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions spec/visual/samples/email
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Greetings and salutations.

I have investigated.

Note: This header-like like shouldn't be highlighted
since it's part of the body text.
Note: A space-stuffed line starting with > is not a quote.
> like this.

--
--
This message is highly confidential and will self-destruct.