Guest User

Untitled

a guest
Feb 19th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 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. | \[(?!([^\[\]]|\[.*+\])*+\][ ]?\[.*+\])
  22. )*?
  23. (?<!
  24. [^\\]\\ # Crazy check for
  25. | [^\\]\\\\\\ # escapes before the
  26. | [^\\]\\\\\\\\\\ # end condition.
  27. )
  28. (?<=\S)\1 # Close
  29. )
  30. ';
  31. end = '(?<=\S)\1';
  32. patterns = (
  33. { begin = '(?=<[^>]*?>)';
  34. end = '(?<=>)';
  35. patterns = (
  36. { include = 'text.html.basic'; },
  37. );
  38. },
  39. { name = 'markup.italic.markdown';
  40. comment = 'Match simple italics for speed';
  41. match = '(\*|_)(?=\S)[-a-zA-Z0-9. ]+?(?<=\S)\1';
  42. },
  43. { include = '#escape'; },
  44. { include = '#ampersand'; },
  45. { include = '#raw'; },
  46. { include = '#italic'; },
  47. { include = '#image-inline'; },
  48. { include = '#link-inline'; },
  49. { include = '#link-inet'; },
  50. { include = '#link-email'; },
  51. { include = '#image-ref'; },
  52. { include = '#link-ref-literal'; },
  53. { include = '#link-ref'; },
  54. );
  55. };
Add Comment
Please, Sign In to add comment