Guest User

Untitled

a guest
Jul 23rd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. const fs = require('fs');
  2. const path = require('path');
  3.  
  4.  
  5. const wrapperHtml = '<p style="text-align: center">&nbsp;&nbsp;</p>';
  6. const contentHtml = '<details style="border: 1px solid blue; WIDTH: 20em"><summary>Test</summary>The quick brown fox jumps over the lazy dog</details>';
  7.  
  8. const tags = [
  9. //Inline tags
  10. 'a',
  11. 'abbr',
  12. 'acronym',
  13. 'b',
  14. 'bdo',
  15. 'big',
  16. 'br',
  17. 'button',
  18. 'cite',
  19. 'code',
  20. 'dfn',
  21. 'em',
  22. 'i',
  23. 'img',
  24. 'input',
  25. 'kbd',
  26. 'label',
  27. 'map',
  28. 'object',
  29. 'q',
  30. 'samp',
  31. 'script',
  32. 'select',
  33. 'small',
  34. 'span',
  35. 'strong',
  36. 'sub',
  37. 'sup',
  38. 'textarea',
  39. 'time',
  40. 'tt',
  41. 'var',
  42.  
  43. //Block-level tags
  44. 'address',
  45. 'article',
  46. 'aside',
  47. 'blockquote',
  48. 'canvas',
  49. 'dd',
  50. 'div',
  51. 'dl',
  52. 'dt',
  53. 'fieldset',
  54. 'figcaption',
  55. 'figure',
  56. 'footer',
  57. 'form',
  58. 'h1',
  59. 'h2',
  60. 'h3',
  61. 'h4',
  62. 'h5',
  63. 'h6',
  64. 'header',
  65. 'hgroup',
  66. 'hr',
  67. 'li',
  68. 'main',
  69. 'nav',
  70. 'noscript',
  71. 'ol',
  72. 'output',
  73. 'p',
  74. 'pre',
  75. 'section',
  76. 'table',
  77. 'tfoot',
  78. 'ul',
  79. 'video'
  80. ];
  81.  
  82.  
  83. const outputFile = path.join(__dirname, 'test-source.html');
  84. let outputStr = '';
  85.  
  86. for (const tag of tags) {
  87. outputStr +=
  88. `<p style="text-align: center">Test tag: [${tag}]<br>\n <${tag} style="display: inline; border: 1px solid red">${contentHtml}</${tag}>\nEnd of test for [${tag}] tag</p>\n\n`;
  89. }
  90.  
  91. fs.writeFileSync(outputFile, outputStr);
Add Comment
Please, Sign In to add comment