Skip to content

Commit

Permalink
Detect PostScript from source
Browse files Browse the repository at this point in the history
  • Loading branch information
taasan committed Feb 21, 2019
1 parent f13ca2e commit 46be13d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/rouge/lexers/postscript.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ class PostScript < RegexLexer
filenames "*.ps", "*.eps"
mimetypes "application/postscript"

def self.detect?(text)
/%^%!/
end

delimiter = %s"()<>\[\]{}/%\s"
delimiter_end = Regexp.new("(?=[#{delimiter}])")
valid_name_chars = Regexp.new("[^#{delimiter}]")
Expand Down

0 comments on commit 46be13d

Please sign in to comment.