File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 99# per ISO 32000-2:2020 clause 12.7.8.
1010#
1111# This is a token-based parser ONLY! It is intended to syntax highlight full or partial fragments
12- # of nicely written hand-writteen PDF syntax in documentation such as ISO specifications. It is NOT
12+ # of nicely written hand-written PDF syntax in documentation such as ISO specifications. It is NOT
1313# intended to cope with real-world PDFs that will contain arbitrary binary data (that form invalid
1414# UTF-8 sequences and generate "ArgumentError: invalid byte sequence in UTF-8" Ruby errors) and
1515# other types of malformations or syntax errors.
@@ -28,8 +28,9 @@ class Pdf < RegexLexer
2828
2929 # PDF and FDF files must start with "%PDF-x.y" or "%FDF-x.y"
3030 # where x is the single digit major version and y is the single digit minor version.
31+ # For simplicity as a syntax highlighter, assumes occurs at start of a line.
3132 def self . detect? ( text )
32- return true if /\A %(P|F)DF-\d .\d / . match? ( text )
33+ return true if /\A %(P|F)DF-\d \ .\d / . match? ( text )
3334 end
3435
3536 # PDF Delimiters (ISO 32000-2:2020, Table 1 and Table 2).
You can’t perform that action at this time.
0 commit comments