toAsciidoc.js 928 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. // Return N time a string
  4. function ns(s, n) {
  5. return Array(n + 1).join(s);
  6. }
  7. exports.default = {
  8. onTitleStart: function (level) {
  9. return `${ns("=", level)} `;
  10. },
  11. onTitleEnd: function (level) {
  12. return this.onBL();
  13. },
  14. onParagraphStart: function () {
  15. return this.onSection();
  16. },
  17. onParagraphEnd: function () {
  18. return this.onSection();
  19. },
  20. onLinkStart: function (href) {
  21. return `link:${href}[`;
  22. },
  23. onLinkEnd: function () {
  24. return "]";
  25. },
  26. onListStart: function (level) {
  27. return "";
  28. },
  29. onListEnd: function () {
  30. return "";
  31. },
  32. onListItemStart: function (level) {
  33. return `${ns(".", level + 1)} `;
  34. },
  35. onListItemEnd: function () {
  36. return "";
  37. },
  38. onHR: function () {
  39. return "'''";
  40. }
  41. };