Commits

Eric Knibbe committed 363de73 Draft

more target fixes

  • Participants
  • Parent commits 18519e9

Comments (0)

Files changed (1)

File bbedit/reStructuredText.plist

 		<string>-\w.:</string>
 		<key>String Pattern</key>
 		<string><![CDATA[(?x:
-			(?<![\w~@#$%^&*)\]}>|+=\\;.,!?]):(?!\s)
+			(?<![\w~@#$%^&*)\]}>|+=\\;.,!?]|\\`):(?!\s)
 			(\\:|:(?=[a-z0-9])|[^:\r])+
 			(?<!\s):(?!(?P<end>[\w~@#$%^&*([{<|+=]))         | (?# role/directive option/field name)
 			(?<![\w~@#$%^&*)\]}>|+=\\;.,!?`])\|(?!\s)
 			([-_+.:](?=[a-z0-9])|[a-z0-9])*__?(?!(?P>end)|`) | (?# hyperlink reference)
 			(?<![\w~@#$%^&*)\]}>|+=\\;.,!?`])`(?!\s)
 			(\\`|`(?=[_~@#$%^&*([{<|+=])|[^`])+
-			(?<![\s\\])`_{0,2}(?!(?P>end))                   | (?# phrase reference/interpreted text)
+			(?<=[^\s\\]|\\\ )`_{0,2}(?!(?P>end))             | (?# phrase reference/interpreted text)
 			(?<![\w~@#$%^&*)\]}>|+=\\;.,!?`])_`(?!\s)
 			(\\`|`(?=[_~@#$%^&*([{<|+=`])|[^`])+
 			(?<![\s\\])`(?!(?P>end)|`)                       | (?# inline internal target)
-			(?<![\w~@#$%^&*)\]}>|+=\\;.,!?])\[
-			([-\w#.]+|\*)\]_(?!(?P>end))                     | (?# footnote/citation reference)
+			(?<![\w~@#$%^&*)\]}>|+=\\;.,!?`])\[
+			([-\w#.]+|\*)\]_(?!(?P>end)|`)                   | (?# footnote/citation reference)
 			(?<=\.\.)[ \t]+\[([-\w#.]+|\*)\](?=\s)           | (?# footnote/citation target)
-			(?<=\.\.)[ \t]+_((\\:|[^:\r])+|`(\\`|[^`\r])+`):(?=[ \t]*)   (?# hyperlink target)
+			(?<=\.\.)[ \t]+_(?(?=`)`(\\`|`(?![ \t]*:\s)
+			|[^`\r])+`|(\\:|:(?!\s)|[^:\r])+)[ \t]*:(?=\s)     (?# hyperlink target)
 		)]]></string>
 		<key>Comment Pattern</key>
 		<string><![CDATA[(?x: