Commits

Eric Knibbe  committed e84fad3 Draft

string improvements
better function pattern: minimum 2 character titles, avoid comments

  • Participants
  • Parent commits 6c27c9e

Comments (0)

Files changed (1)

File bbedit/reStructuredText.plist

 		<key>String Pattern</key>
 		<string><![CDATA[(?x:
 			(?<![\w~@#$%^&*)\]}>|+=\\;.,!?]):(?!\s)
-			\w(:(?=\w)|[-\w.+='" \t])*
+			\w(:(?=[a-z0-9])|[-\w.+='" \t])*
 			(?<!\s):(?!(?P<end>[\w~@#$%^&*([{<|+=]))      | (?# role/directive option/field name)
 			(?<![\w~@#$%^&*)\]}>|+=\\;.,!?])\|(?!\s)
 			(\|(?=(?P>end))|[^|\r])+
 			(?<![\s\\])\|_{0,2}(?!(?P>end))               | (?# substitution)
-			(?<![_~@#$%^&*)\]}>|+=\\;.,!?])\b[a-zA-Z0-9]
-			[-\w]*__?(?!(?P>end))                         | (?# hyperlink reference)
+			(?<![_~@#$%^&*)\]}>|+=\\;.,!?])\b[a-z0-9]
+			([-_.:+](?=[a-z0-9])|[a-z0-9])*__?(?!(?P>end)) | (?# hyperlink reference)
 			(?<![\w~@#$%^&*)\]}>|+=\\;.,!?`])`(?!\s)
 			(\\`|[^`])+(?<!\s)`_{0,2}(?!(?P>end))         | (?# phrase reference/interpreted text)
 			(?<![\w~@#$%^&*)\]}>|+=\\;.,!?])_`(?!\s)
 			(\A | ^[ \t]*\r) (
 				(?P<pad>[ \t]*)\.\. (
 					[ \t]+ (
-						([-+.a-zA-Z0-9] | (?<!\b)_)+ (?(?=\ ?:)
+						([-+.a-z0-9] | (?<!\b)_)+ (?(?=\ ?:)
 							\ ?:(([^:] | :(?=[^\s]))[^\r]* | $)
 							| ([^-+.\w][^\r]* | $)
 						) | [^\w[|\s][^\r]*
 		<key>Function Pattern</key>
 		<string><![CDATA[(?x:
 			(?P<function>
-				^\ ?(?P<function_name>[^\r]+)\r
+				^(?!\.\.\s)\ ?(?P<function_name>\S[^\r]+)\r
 				^(?P<bar>[-=`:.'"~^_*+#!$%&(),/;<>?@[\]\{|}])(?P=bar)+\s*$
-				(?s).*?
+				(?s).*?(?-s)
 			)
 			(?=
-				(\r
-					(?-s).+\r
+				(^\s*\r
+					^(?!\.\.\s)\ ?\S[^\r]+\r
 					^(?P<nextbar>[-=`:.'"~^_*+#!$%&(),/;<>?@[\]\{|}])(?P=nextbar)+\s*$
 				) | (?-m)$
 			)