Guest User

Untitled

a guest
Feb 19th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. bold = {
  2. name = 'markup.bold.markdown';
  3. begin = '(?x)
  4. (\*\*|__)(?=\S) # Open
  5. (?=
  6. (
  7. [^\<`\[] # Ignore html tags and
  8. # raw states.
  9. | <[^>]*+> # HTML tags
  10. | <(?=[^>\n]*+$) # Open bracket otherwise
  11. | ``([^`]|`(?!`))*+`` # Raw v1
  12. | `([^\\`]|\\.)*+` # Raw v2
  13. | \\` # Escaped backtick
  14. | \[
  15. (?<square> # Named group
  16. [^\[\]\\] # Match most chars
  17. | \\. # Escaped chars
  18. | \[ \g<square>*+ \] # Nested brackets
  19. )*+
  20. \]
  21. [ ]? # Optional space
  22. \[[^\]]*+\] # Ref name
  23. | \[(?!(?<square2>[^\[\]\\]|\\.|\[ \g<square2>*+ \])*+\][ ]?\[[^\]]*+\])
  24. )*?
  25. (?<!
  26. [^\\]\\ # Crazy check for
  27. | [^\\]\\\\\\ # escapes before the
  28. | [^\\]\\\\\\\\\\ # end condition.
  29. )
  30. (?<=\S)\1 # Close
  31. )
  32. ';
  33. end = '(?<=\S)\1';
  34. patterns = (
  35. { begin = '(?=<[^>]*?>)';
  36. end = '(?<=>)';
  37. patterns = (
  38. { include = 'text.html.basic'; },
  39. );
  40. },
  41. { name = 'markup.italic.markdown';
  42. comment = 'Match simple italics for speed';
  43. match = '(\*|_)(?=\S)[-a-zA-Z0-9. ]+?(?<=\S)\1';
  44. },
  45. { include = '#escape'; },
  46. { include = '#ampersand'; },
  47. { include = '#raw'; },
  48. { include = '#italic'; },
  49. { include = '#image-inline'; },
  50. { include = '#link-inline'; },
  51. { include = '#link-inet'; },
  52. { include = '#link-email'; },
  53. { include = '#image-ref'; },
  54. { include = '#link-ref-literal'; },
  55. { include = '#link-ref'; },
  56. );
  57. };
Add Comment
Please, Sign In to add comment