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
- | \[
- (?<square> # Named group
- [^\[\]\\] # Match most chars
- | \\. # Escaped chars
- | \[ \g<square>*+ \] # Nested brackets
- )*+
- \][ ]?\[.*+\]
- | \[(?!([^\[\]]|\[.*+\])*+\][ ]?\[.*+\])
- )*?
- (?<!
- [^\\]\\ # 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