Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bold = {
- name = 'markup.bold.markdown';
- begin = '(?x)
- (\*\*|__)(?=\S) # Open
- (?=
- (
- [^\<`\[\\] # Ignore html tags and
- # raw states.
- | <[^>]*+> # HTML tags
- | <(?=[^>\n]*+$) # Open bracket otherwise
- | ``([^`]|`(?!`))*+`` # Raw v1
- | `([^\\`]|\\.)*+` # Raw v2
- | \\` # Escaped backtick
- | \[
- (?<link>
- (?<square> # Named group
- [^\[\]\\] # Match most chars
- | \\. # Escaped chars
- | \[ \g<square>*+ \] # Nested brackets
- )*+
- \]
- (
- ( # Reference Link
- [ ]? # Optional space
- \[[^\]]*+\] # Ref name
- )
- | ( # Inline Link
- \( # Opening paren
- [ \t]*+ # Optional whtiespace
- <?(.*?)>? # URL
- [ \t]*+ # Optional whtiespace
- ( # Optional Title
- (?<title>[''"])
- (.*?)
- \k<title>
- )?
- \)
- )
- )
- )
- | \[(?!\g<link>)
- )*?
- (?<!
- [^\\]\\ # Crazy check for
- | [^\\]\\\\\\ # escapes before the
- | [^\\]\\\\\\\\\\ # end condition.
- )
- (?<=\S)\1 # Close
- )
- ';
- end = '(?<=\S)\1';
- patterns = (
- { begin = '(?=<[^>]*?>)';
- end = '(?<=>)';
- patterns = (
- { include = 'text.html.basic'; },
- );
- },
- { name = 'markup.italic.markdown';
- comment = 'Match simple italics for speed';
- match = '(\*|_)(?=\S)[-a-zA-Z0-9. ]+?(?<=\S)\1';
- },
- { include = '#escape'; },
- { include = '#ampersand'; },
- { include = '#raw'; },
- { include = '#italic'; },
- { include = '#image-inline'; },
- { include = '#link-inline'; },
- { include = '#link-inet'; },
- { include = '#link-email'; },
- { include = '#image-ref'; },
- { include = '#link-ref-literal'; },
- { include = '#link-ref'; },
- );
- };
Add Comment
Please, Sign In to add comment