/
(?:\n|\A)[ ]*
# 1: Opening marker
(
[ ]{0,2}(?:~{3,}|`{3,}) # 3 or more tildes/backticks.
)
[ ]*
(?:
\.?([\w-_:\.\/\{\+\},\@]+) # 2: standalone class name
|
\{((?:[ ]*[#.][-_:a-zA-Z0-9]+){1,})[ ]*\} # 3: Extra attributes
)?
[ ]* \n # Whitespace and newline following marker.
# 4: Content
(
(?>
(?!\1 [ ]* \n) # Not a closing marker.
.*\n+
)+
)
# Closing marker.
\1 [ ]* (?= \n )
/
mxg