Guest User

Untitled

a guest
Feb 19th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 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. (?<link>
  16. (?<square> # Named group
  17. [^\[\]\\] # Match most chars
  18. | \\. # Escaped chars
  19. | \[ \g<square>*+ \] # Nested brackets
  20. )*+
  21. \]
  22. (
  23. ( # Reference Link
  24. [ ]? # Optional space
  25. \[[^\]]*+\] # Ref name
  26. )
  27. | ( # Inline Link
  28. \( # Opening paren
  29. [ \t]*+ # Optional whtiespace
  30. <?(.*?)>? # URL
  31. [ \t]*+ # Optional whtiespace
  32. ( # Optional Title
  33. (?<title>[''"])
  34. (.*?)
  35. \k<title>
  36. )?
  37. \)
  38. )
  39. )
  40. )
  41. | \[(?!\g<link>)
  42. )*?
  43. (?<!
  44. [^\\]\\ # Crazy check for
  45. | [^\\]\\\\\\ # escapes before the
  46. | [^\\]\\\\\\\\\\ # end condition.
  47. )
  48. (?<=\S)\1 # Close
  49. )
  50. ';
  51. end = '(?<=\S)\1';
  52. patterns = (
  53. { begin = '(?=<[^>]*?>)';
  54. end = '(?<=>)';
  55. patterns = (
  56. { include = 'text.html.basic'; },
  57. );
  58. },
  59. { name = 'markup.italic.markdown';
  60. comment = 'Match simple italics for speed';
  61. match = '(\*|_)(?=\S)[-a-zA-Z0-9. ]+?(?<=\S)\1';
  62. },
  63. { include = '#escape'; },
  64. { include = '#ampersand'; },
  65. { include = '#raw'; },
  66. { include = '#italic'; },
  67. { include = '#image-inline'; },
  68. { include = '#link-inline'; },
  69. { include = '#link-inet'; },
  70. { include = '#link-email'; },
  71. { include = '#image-ref'; },
  72. { include = '#link-ref-literal'; },
  73. { include = '#link-ref'; },
  74. );
  75. };
Add Comment
Please, Sign In to add comment