aboutsummaryrefslogtreecommitdiff
path: root/CommonMark.dtd
blob: 62e5c8a4583c548882973816a93ce47b456e231a (plain)
  1. <!-- DTD for CommonMark xml export format -->
  2. <!ENTITY % block
  3. 'block_quote|list|code_block|paragraph|heading|thematic_break|html_block|custom_block'>
  4. <!ENTITY % inline
  5. 'text|softbreak|linebreak|code|emph|strong|link|image|html_inline|custom_inline'>
  6. <!ELEMENT document (%block;)*>
  7. <!ATTLIST document
  8. xmlns CDATA #FIXED "http://commonmark.org/xml/1.0">
  9. <!-- block elements -->
  10. <!ELEMENT block_quote (%block;)*>
  11. <!ELEMENT list (item)+>
  12. <!ATTLIST list
  13. type (bullet|ordered) #REQUIRED
  14. start CDATA #IMPLIED
  15. tight (true|false) #REQUIRED
  16. delimiter (period|paren) #IMPLIED>
  17. <!ELEMENT item (%block;)*>
  18. <!ELEMENT code_block (#PCDATA)>
  19. <!ATTLIST code_block
  20. xml:space CDATA #FIXED "preserve"
  21. info CDATA #IMPLIED>
  22. <!ELEMENT paragraph (%inline;)*>
  23. <!ELEMENT heading (%inline;)*>
  24. <!ATTLIST heading
  25. level (1|2|3|4|5|6) #REQUIRED>
  26. <!ELEMENT thematic_break EMPTY>
  27. <!ELEMENT html_block (#PCDATA)>
  28. <!ATTLIST html_block
  29. xml:space CDATA #FIXED "preserve">
  30. <!ELEMENT custom_block (%inline;|%block;|item)*>
  31. <!ATTLIST custom_block
  32. on_enter CDATA #IMPLIED
  33. on_exit CDATA #IMPLIED>
  34. <!-- inline elements -->
  35. <!ELEMENT text (#PCDATA)>
  36. <!ELEMENT softbreak EMPTY>
  37. <!ELEMENT linebreak EMPTY>
  38. <!ELEMENT code (#PCDATA)>
  39. <!ATTLIST code
  40. xml:space CDATA #FIXED "preserve">
  41. <!ELEMENT emph (%inline;)*>
  42. <!ELEMENT strong (%inline;)*>
  43. <!ELEMENT link (%inline;)*>
  44. <!ATTLIST link
  45. destination CDATA #REQUIRED
  46. title CDATA #IMPLIED>
  47. <!ELEMENT image (%inline;)*>
  48. <!ATTLIST image
  49. destination CDATA #REQUIRED
  50. title CDATA #IMPLIED>
  51. <!ELEMENT html_inline (#PCDATA)>
  52. <!ATTLIST html_inline
  53. xml:space CDATA #FIXED "preserve">
  54. <!ELEMENT custom_inline (%inline;)*>
  55. <!ATTLIST custom_inline
  56. on_enter CDATA #IMPLIED
  57. on_exit CDATA #IMPLIED>
  58. <!-- All elements can have a sourcepos attribute.
  59. The format is SL:SC-EL:EC
  60. where SL = number of starting line (first line = 1)
  61. EL = number of ending line
  62. SC = number of starting column (first column = 1)
  63. EC = number of ending column
  64. -->
  65. <!ATTLIST ANY sourcepos CDATA #IMPLIED>