block-code.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. function pug_escape(e) {
  2. var a = "" + e, t = pug_match_html.exec(a);
  3. if (!t) return e;
  4. var r, c, n, s = "";
  5. for (r = t.index, c = 0; r < a.length; r++) {
  6. switch (a.charCodeAt(r)) {
  7. case 34:
  8. n = "&quot;";
  9. break;
  10. case 38:
  11. n = "&amp;";
  12. break;
  13. case 60:
  14. n = "&lt;";
  15. break;
  16. case 62:
  17. n = "&gt;";
  18. break;
  19. default:
  20. continue;
  21. }
  22. c !== r && (s += a.substring(c, r)), c = r + 1, s += n;
  23. }
  24. return c !== r ? s + a.substring(c, r) : s;
  25. }
  26. var pug_match_html = /["&<>]/;
  27. function template(locals) {
  28. var pug_html = "", pug_mixins = {}, pug_interp;
  29. var locals_for_with = locals || {};
  30. (function(list, string) {
  31. list = [ "uno", "dos", "tres", "cuatro", "cinco", "seis" ];
  32. (function() {
  33. var $$obj = list;
  34. if ("number" == typeof $$obj.length) {
  35. for (var pug_index0 = 0, $$l = $$obj.length; pug_index0 < $$l; pug_index0++) {
  36. var item = $$obj[pug_index0];
  37. string = item.charAt(0).toUpperCase() + item.slice(1);
  38. pug_html = pug_html + "<li>" + pug_escape(null == (pug_interp = string) ? "" : pug_interp) + "</li>";
  39. }
  40. } else {
  41. var $$l = 0;
  42. for (var pug_index0 in $$obj) {
  43. $$l++;
  44. var item = $$obj[pug_index0];
  45. string = item.charAt(0).toUpperCase() + item.slice(1);
  46. pug_html = pug_html + "<li>" + pug_escape(null == (pug_interp = string) ? "" : pug_interp) + "</li>";
  47. }
  48. }
  49. }).call(this);
  50. }).call(this, "list" in locals_for_with ? locals_for_with.list : typeof list !== "undefined" ? list : undefined, "string" in locals_for_with ? locals_for_with.string : typeof string !== "undefined" ? string : undefined);
  51. return pug_html;
  52. }