 			{
 				contentName: "source.embedded.stata"
 				patterns: [include: "source.stata"]
-				begin: "^([ \\t]*)(\\.\\.)\\s+(code(?:-block)?)(::)\\s+(stata)\\s*$"
+				begin: "^([ \\t]*)(\\.\\.)\\s+(code(?:-block)?)(::)\\s+(stata)(?=\\s*$)"
 				end:   "^(?!\\s*$|\\1[ \\t]+\\S)"
 				beginCaptures:
 					2: name: "punctuation.definition.directive.restructuredtext"


			# HTML
			{
				begin: "^([ \\t]*)(\\.\\.)\\s+(raw|code(?:-block)?)(::)\\s+(html)\\s*$"
				end:   "^(?!\\s*$|\\1[ \\t]+\\S)"
				patterns: [include: "text.html.basic"]
				beginCaptures:

					captures:
						1: patterns: [include: "text.roff"]
				}]
				begin: "^([ \\t]*)(\\.\\.)\\s+(code(?:-block)?|raw)(::)\\s+(manpage|man|[ntg]?roff)(?=\\s*$)"
				end:   "^(?!\\s*$|\\1[ \\t]+\\S)"
				beginCaptures:
					2: name: "punctuation.definition.directive.restructuredtext"
